Create JVM after destroying it
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 describ开发者_开发技巧es 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 faced this issue long time back. Here is the relevant bug entry - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4712793
I've found a couple of forum postings that report that CreateJavaVM / DestroyJavaVM / CreateJavaVM doesn't work; e.g.
- http://lists.apple.com/archives/java-dev/2004/Mar/msg00966.html
- http://comments.gmane.org/gmane.comp.jakarta.poi.user/11742
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.)
精彩评论