× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ali Ekinci wrote:
> ...
> Barbara (or somebody else knows this), 
> Could you clarify this, And answer following questions?
> 1) If I start JVM via JNI_CreateJavaVM, and end it via DestroyJavaVM, Can I 
> restart it with JNI_CreateJavaVM again? (I have been doing this, and so far 
> never had any problems in V5R1, may be I got lucky. Recently got v5r2 and I 
> ran OK too. But wanna make sure it wasn't a luck.)
> 
> 2) If I start JVM via JNI_CreateJavaVM, and end Java ends JVM with 
> System.exit(n), Can I restart it with JNI_CreateJavaVM again?
> 

I'm not an expert on this ...

1) My understanding is that the DestroyJavaVM wouldn't do anything (and
that's what the "Java Programming Changes" thing says: "In V5R2, the
DestroyJavaVM function returns an error code").  So your second
JNI_CreateJavaVM wouldn't actually be creating a new one.  You could
check this by changing your CLASSPATH environment variable between the
destroy and the second create, and see if it has any effect.

Are you checking the return codes from your calls to the JNI functions?

2) Assuming that System.exit(n) does end the JVM, then my understanding
is that you can't start another one.  (I don't think there's ever been
any "restart" of a JVM - in V5R1 it's always been a brand new one, as
far as I know.)

But this seems pretty clear: "In V5R2, the JNI_CreateJavaVM function
returns an error code (JNI_EEXIST -5 VM Already Created as defined in
jni.h) whenever a Java virtual machine has already been created in the
current process."

It doesn't suggest that anything would be different if the created one
had been destroyed.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.