invoking java exe from C++ code

Most of my applications are in c++, i have one application in java.How can I invoke the java application(jar) from c++ code?
[138 byte] By [123_abcda] at [2007-11-26 17:27:02]
# 1
As far as I know, there are Java-C++ bridges (however, I'm not sure whether they are free or commercial), but essentially you need to invoke (exec()) JVM and pass your jar name as a parameter -- just like you do from command line:$ java -jar myapp.jar
MaximKartasheva at 2007-7-8 23:54:59 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

There is no big difference between invoking a C/C++ application

from a C/C++ code, or invoking a Java application.

Suppose you use the following command to start you Java app:

% java app

You can use function "system()" to invoke it from C/C++ code:

system("java app");

Thanks,

Nik

Nik.Molchanova at 2007-7-8 23:54:59 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

Hi We can do this by using EXTERN C functionality provided by c++ ,

by using this we can call the Java functions from Java .class file.

or .jar file.

(for java developers ......its similer to JNI)

if you want more details aboth such code just search it on web , you will get number of programs here.

Thanks,

-Akshay

Akshay_RDa at 2007-7-8 23:54:59 > top of Java-index,Development Tools,Solaris and Linux Development Tools...