Tuesday, July 8, 2003 06:15 PM
I can only tell you that it is definitely possible to load the jvm.dll dynamically from a C/C++ process. If you have a problem, it's most likely due to a bug in your code.
In the JunC++ion framework, the JVM to be used is specified in an external configuration (registry on Windows or file on Unix) and the specified JVM is loaded automatically as needed.
You need to maintain the JRE structure of course (you cannot copy just a jvm.dll to a different place). BTW: you are required to do that anyway under the JRE license. You can embed a JRE in your application and find the JVM relative to your binary.
The other key for flexibility is not to link against the jvm.dll. This will require you to find the invocation interface entry points through function lookup.
All these problems can easily be avoided by using the above tool. It is commercial and has a price, but it solves the problem. I'm a principal in the company, just so you know that I'm not independent.