Jump to content
Excelsior Forums
Sign in to follow this  
FrankZado

JET DLL in Visual C++ 6.0

Recommended Posts

I've just been tasked with taking the JAVA portion of a program we work with and run it through JET, in order to provide a measure of code protection before the program gets released. Seeing as the JAVA portion of the program is actually run from C++ code (the C++ code instantiates a JavaVM and runs the Java portion), I thought it best to use JET to package the JAVA portion as a DLL file, which can then be accessed via JNI.

The one problem I've been having is that I am unable to make VC++ utilize the xjvm.lib file, at least from utilizing the GUI. In the Project Setting for the module that creates the executable I specified the lib file under the Link tab and in Object/library modules. I thought this was it, but I think I'm wrong. It compiles fine, and when I load the program it loads the DLL file but can never find any of the class files. I wrote a quick wrapper class which uses the exact same code to instantiate the VM, load the dll, load the class file, and call the constructor. I compiled this simple wrapper on the command line, making sure to link the xjvm.lib file. Running this method, everything worked. The class was found, the Java code did as it should, and I got the .usg file.

Is there something anyone might know that I would be missing in the GUI portion of VC++ to get it to properly link the xjvm.lib file? I'd rather not do it command line, as there isn't a batch file for it, and there are some 25 separate modules in the program to deal with, and many dependencies which are already set in the GUI. If any could point me in the right direction, I would be GREATLY appreciative....thanks!

Frank

Share this post


Link to post
Share on other sites

Are you sure that initialization code is actually executed in your "big" (launched from GUI) application? In particular, does the call to JNI_CreateJavaVM succeeded?

I propose you to try to launch the simplest invocation example (e.g. samples\Invocation\JavaHello) both from command-line and GUI. I hope this would help you to catch the difference in the behavior and solve your problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×