Solved

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

Posted on 1998-11-07
3
178 Views
Last Modified: 2013-11-24
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
Comment
Question by:phalley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 1227067
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
 
LVL 16

Accepted Solution

by:
heyhey_ earned 70 total points
ID: 1227068
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
 

Author Comment

by:phalley
ID: 1227069
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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
A solution for Fortify Path Manipulation.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question