ERROR: JDWP Unable to get JNI 1.2 environment

I get this error after debugging in Eclipse. However, debugging was successful.

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?

+62
java eclipse jdwp
Feb 08 '10 at 23:43
source share
6 answers

Looks like http://bugs.sun.com/view_bug.do?bug_id=6476706 , which has a low priority and is still not fixed. Definitely a Mustang mistake, but no clear explanation (it seems to happen quite randomly according to bug reporters in addition to this).

+27
Feb 09 '10 at 0:00
source share

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

That is all you have to do.

+66
Apr 27 '11 at 9:50 a.m.
source share

This is apparently a JVM bug. It is harmless and unpredictable.

+3
Feb 08 '10 at 23:59
source share

It happens 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()); 

It happens if you run the program too quickly several times to do something 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] 
+3
May 23 '12 at 19:44
source share

@ In total, I encounter this problem, using the API for reading and writing images over the network, when I run a program that works with local files, this does not happen. After checking my results, I confirmed that it really does no harm (at least to my debugging). Now, when I read this post, I stopped looking at it.

0
May 22 '12 at 11:07
source share

I noticed that this happens when I use the workspace stored on my USB drive, and sometimes on my work network. This is not a serious problem and does not seem to affect the execution of any of my programs. I tested the solution @Vasile Surdu with the addition of 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.

0
Feb 18 '16 at 23:46
source share



All Articles