dcsimg
The problem with running JVM using jvm.dll What about other ways to invoke Java code from C ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sregiy_Prutskov
Posted On:   Tuesday, July 1, 2003 01:06 PM

I have the problem with creating JVM using jvm.dll (no matter hotspot or classic) if I loaded one of this dll from place on hard disk where it hadn’t been originally installed (I have JBuilder).

Is it normally? What is the reason for it? How can I get it around ? How then can I move applications to different computer?

Where can I get more information about CNI interface?

What are the other ways to invoke Java code from C programms?

Re: The problem with running JVM using jvm.dll What about other ways to invoke Java code from C ?

Posted By:   Alexander_Krapf  
Posted On:   Tuesday, July 8, 2003 06:15 PM

Hi Sregiy,


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.


Good luck,


Alex

About | Sitemap | Contact