• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

How do I call a C or C++ program in a Java Applet?

I need to call a C or C++ program, compiled with Visual C++ 5.0. This program has to be included in a Java applet, for its deployment in a intranet/internet environment. The executable code of the C program is located in the Web Server. Can anyone tell me how to do this?
0
phalley
Asked:
phalley
1 Solution
 
BigRatCommented:
The problem with a Java Applet (embedded in a HTML page and downloaded, is that the security regulations are quite severe. The simplest solution would be to encapsulate the program into a Java Servlet and access it from the applet via RMI.
   One would need to know a bit more about the program though, before one could really be of help. One would.
0
 
heyhey_Commented:
Java applications can call native procedures but:
1. you lose platform independance
2. it seems that Microsoft's VM still don't support Sun's NativeInterface standard

now the applets
1. applets are downloadable - so the platform inipendance is much more needed !!!
2. applets must be secure, so ordinary applets CAN'T execute native code.
3. you'll have problems with downloading native code (for WIn95 it is DLL file) and installing it so that the OS can see and use it ...

so what:
1. it seems that you can use applets with native code.
2. you can use Java application + native code, but why - you better
2.1. implement everything in VC (why Java ???)
2.2. rewrite everything in Java
2.3. rewrite the VC part as a server application. Java applets can connect (using TCP) with that application and so on ...
0
 
phalleyAuthor Commented:
Regarding Heyhey's answer, we need Java because we have Sun Workstation as clients, so we need the Virtual Machine for the clients. It was a good suggest to rewrite the VC as a server and communicate with TCP
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now