错误:JDWP 无法获取 JNI 1.2 环境
在 Eclipse 中调试后出现此错误。不过调试成功了。
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]
这是什么意思?
I get this error after debugging in Eclipse. The debug is successful though.
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]
What does it mean?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
只需将
System.exit(0);
添加到 main 方法的末尾即可。这就是你所要做的。
Just add
System.exit(0);
to the end of your main method.That's all you have to do.
看起来像 https://bugs.java.com/bugdatabase/view_bug?bug_id=6476706< /a> 优先级较低,尚未修复。绝对是野马错误,但没有明确的解释(根据错误报告者的说法,似乎是随机发生的)。
Looks like https://bugs.java.com/bugdatabase/view_bug?bug_id=6476706 which has low priority and is still not fixed. Definitely a Mustang bug but no clear explanation (seems to occur pretty randomly according to the bug reporters on top of that).
这显然是一个 JVM 错误。它是无害且不可预测的。
It's apparently a JVM bug. It's harmless and unpredictable.
发生在像本教程这样简单的事情上
如果多次运行程序太快就会发生,所以与系统性能有关?
Happens on something as simple as this tutorial
Happens if run program too fast multiple times so something to do with system performance?
@Everyone 我在使用图像 API 通过网络读取和写入文件时遇到了这个问题,当我运行使用本地文件的程序时,这种情况不会发生。在验证我的结果后,我确认它确实没有任何危害(至少在我的调试中)。现在我正在阅读这篇文章,我不再研究它。
@Everyone I'm facing this problem using the image API reading and writing files over the network, when I run the program working with local files this doesn't happen. After verifiying my results I confirmed that it really doesn't do any harm (at least on my debugging). Now that I'm reading this post I stopped looking into it.
我注意到当我使用存储在 USB 驱动器上(有时在工作网络上)的工作区时会发生这种情况。这不是一个主要问题,似乎对我的任何程序的执行都没有任何影响。我测试了 @Vasile Surdu 的解决方案,将 System.exit(0); 添加到 main 方法的末尾,并且它有效。
另一个解决方案是重新启动 eclipse
这对我来说大部分时间都有效。I have noticed this occurs when I am using a workspace stored on my USB drive and sometimes on my work's network. It is not a major issue and doesnt seem to have any effect on the execution of any of my programs. I tested @Vasile Surdu's solution of adding
System.exit(0);
to the end of the main method and it works.Another solution is to restart eclipse
which works for me most of the time.