From: kt on
I want to include a java jar file in my VC++ application and use the
methods in the classes in that jar file. Is it possible to do so? and
if yes can anyone help me with it??
From: Carl Daniel [VC++ MVP] on
kt wrote:
> I want to include a java jar file in my VC++ application and use the
> methods in the classes in that jar file. Is it possible to do so? and
> if yes can anyone help me with it??

Sure - you'll need to bundle your app with a JVM (or require that one be
installed) and use the JNI (Java Native Interface) from your C++ application
to call your Java code. It's not pretty. I have seen articles & pre-built
C++ class libraries that can help eliminate a lot of the tedium. Google is
your friend here.

-cd


From: Ben Voigt [C++ MVP] on
Carl Daniel [VC++ MVP] wrote:
> kt wrote:
>> I want to include a java jar file in my VC++ application and use the
>> methods in the classes in that jar file. Is it possible to do so? and
>> if yes can anyone help me with it??
>
> Sure - you'll need to bundle your app with a JVM (or require that one
> be installed) and use the JNI (Java Native Interface) from your C++
> application to call your Java code. It's not pretty. I have seen
> articles & pre-built C++ class libraries that can help eliminate a
> lot of the tedium. Google is your friend here.

Or, if you're willing to take a dependency on the (possibly illegal)
Microsoft VM, then Java classes appear as COM objects.

Talk to a lawyer first though, to find out what redistribution rights your
Visual Studio license conveys to the MS JVM.

>
> -cd