销毁后创建JVM [英] Create JVM after destroying it
问题描述
我试图在调用destroyVM之后调用JNI_CreateVM,但它总是返回-1。这是JDK中的错误吗?
I am trying to call JNI_CreateVM after calling destroyVM but it always return -1. Is that a bug in JDK?
我发现以下链接描述了同样的问题:
JNI Bug
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?
谢谢,
Sami
推荐答案
我发现有几个论坛帖子报告说CreateJavaVM / DestroyJavaVM / CreateJavaVM不起作用;例如
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
- http://lists.apple.com/archives/java-dev/2004/Mar/msg00966.html
- http://comments.gmane.org/gmane.comp.jakarta.poi.user/11742
一致认为,由于JVM的限制,DestroyJavaVM无法完全正常工作。有些人报告说它一直在返回-1。甚至JNI规范也暗示了局限性。
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.
在Bug数据库中似乎没有这样的条目,但它可能只是Oracle已经关闭/删除/隐藏较早的条目。 (他们似乎最近一直在清理数据库的公共视图,搜索通常无法正常工作。)
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.)
这篇关于销毁后创建JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!