JNI for DELPHI : DestroyJavaVM Problem

Z

zorba

I am using Delphi to call Java methods using JNI. It works fine on
the first run - Create JVM - find class and method - call method -
Free JMV. However when i call it for a second time i get an error code
of -1 when trying to create the JVM.

I think the reason for this is that the com+ dll object we use is not
shoutdown when the client is shut down as many different app use that
dll??
This may have absolutley no baring on the problem but i thought i
would mention it.

I have tried to use DestroyJavaVM when finished with it but it does
not appear to work, as i still get the above error of -1 when creating
the JVM.
I have also tried to see if the JVM is already running and not create
a new one if it is. (Not confident that i coded this correctly)

Can anyone help

Cheers
 
G

Gordon Beaton

I am using Delphi to call Java methods using JNI. It works fine on
the first run - Create JVM - find class and method - call method -
Free JMV. However when i call it for a second time i get an error
code of -1 when trying to create the JVM.

According to the documentation for DestroyJavaVM, "The JVM still does
not support unloading".

If you need to make multiple calls into a JVM from native code, start
one and keep it alive until the process terminates.

/gordon
 
Z

zorba

Thank you

Gordon Beaton said:
According to the documentation for DestroyJavaVM, "The JVM still does
not support unloading".

If you need to make multiple calls into a JVM from native code, start
one and keep it alive until the process terminates.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top