错误:JDWP 无法获取 JNI 1.2 环境

发布于 2024-08-20 16:35:37 字数 241 浏览 6 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

绿萝 2024-08-27 16:35:38

只需将 System.exit(0); 添加到 main 方法的末尾即可。

这就是你所要做的。

Just add System.exit(0); to the end of your main method.

That's all you have to do.

猫七 2024-08-27 16:35:38

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).

日裸衫吸 2024-08-27 16:35:38

这显然是一个 JVM 错误。它是无害且不可预测的。

It's apparently a JVM bug. It's harmless and unpredictable.

同展鸳鸯锦 2024-08-27 16:35:38

发生在像本教程这样简单的事情上

//trim spaces
String s2 = "Welcome!";
int len1 = s2.length();
System.out.println(len1);
String s3 = s2.trim();
System.out.println(s3.length());

如果多次运行程序太快就会发生,所以与系统性能有关?

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:838]

Happens on something as simple as this tutorial

//trim spaces
String s2 = "Welcome!";
int len1 = s2.length();
System.out.println(len1);
String s3 = s2.trim();
System.out.println(s3.length());

Happens if run program too fast multiple times so something to do with system performance?

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:838]
我的影子我的梦 2024-08-27 16:35:38

@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.

紫罗兰の梦幻 2024-08-27 16:35:38

我注意到当我使用存储在 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 addingSystem.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文