I am trying to call JNI_CreateVM after calling destroyVM but it always return -1. Is that a bug in JDK?
I found the following link that describes the same problem:
JNI Bug
The link has a sample code that reproduces the issue that I hace. Does anybody have an idea how to resolve this issue?
Thanks,
Sami
I’ve found a couple of forum postings that report that CreateJavaVM / DestroyJavaVM / CreateJavaVM doesn’t work; e.g.
The consensus is that DestroyJavaVM doesn’t completely work due to limitations in the JVM. Some people report that it is consistently returning -1. Even the JNI spec hints at limitations.
There doesn’t seem to be an entry in the Bug Database for this, but it could just be that Oracle has closed / deleted / hidden earlier entries. (They seem to have been “spring cleaning” the public view of the database recently, and searches often don’t work properly.)