ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2

来源:互联网 发布:不要网络的单机麻将 编辑:程序博客网 时间:2024/05/16 05:47

ERROR JDWP Unable to get JNI 1.2 environment, jvm-GetEnv() return code = -22008-08-26 10:20注:取材网络,收集归纳,以备所需。

我在Eclipse下启动Tomcat6.0时正常,但关闭Tomcat6.0后,控制台输出如下错误信息,不知道是为什么?请指教。谢谢!

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]

这是因为如果不指定默认的输入输入设备,jdk1.6会指定为键盘默认的输入设备,调用的地方为默认的输出设备。而Eclipse的调用显然不是!

你用的是1.6的JDK吧,这个是一个JDK的Bug(id=6476706)
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476706


Bug ID: 6476706
Votes 47
Synopsis Error AGENT_ERROR_NO_JNI_ENV printed sometimes to console when JVM finishes
Category java:debugger
Reported Against b99
Release Fixed  
State In progress, bug
Priority: 4-Low
Related Bugs  
Submit Date 29-SEP-2006
Description The following error is printed to console when debugger is about to finish:

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]

It was found by other people as well:

http://www.google.co.uk/search?hl=en&q=AGENT_ERROR_NO_JNI_ENV%28183%29++util.c%3A820&btnG=Google+Search&meta

I am able to reproduce it with xxxxx IDE (http://www.netbeans.org/issues/show_bug.cgi?id=85538):

- install xxxxx IDE 6.0
- create a java project
- add two lines to main method (System.out.println("aaa");System.out.println("bbb");)
- add customer to the first line
- start debugger (F5)
- continue when it stops at customer . The error message above is SOMETIMES
printed to output window.

Build NB 6.0 20060919-0644, JDK1.6.0-b99, WindowsXP.
Posted Date : 2006-09-29 11:59:37.0

An e-mail comment from Alan:

> It sounds like a timing issue in the shutdown with the agent still running.
Posted Date : 2007-03-13 16:11:28.0


Work Around N/A

Evaluation N/A

Comments     
Include a link with my name & email  

Submitted On 22-NOV-2006
Still in
Sun Microsystems Inc. 1.6.0-rc


Submitted On 13-DEC-2006
i have same errors too...


Submitted On 16-DEC-2006
I get this error also...


Submitted On 17-DEC-2006
Me too...


Submitted On 28-DEC-2006
Mikhail0s same


Submitted On 02-JAN-2007
njusohohchaser 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]


Submitted On 02-JAN-2007
so wot?


Submitted On 10-JAN-2007
Betlista Same problem with eclipse :-/


Submitted On 10-JAN-2007
Betlista In main method there could be no code and error occures, so there will be (I think) no workaround...


Submitted On 12-JAN-2007
I got similar error.

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]


Submitted On 14-JAN-2007
JonRWoods Happens one in ten times for me too when debugging short programs. JDK 1.6.0 (build 1.6.0-b105) on Windows XP Professional from Eclipse 3.2.1. As for others:

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]


Submitted On 21-JAN-2007
Still appears in build 105


Submitted On 23-JAN-2007
Happened to me this morning debugging in NetBeans


Submitted On 24-JAN-2007
jwcarman Happens to me within IntelliJ IDEA. I wrote a simple "Hello, World" main() method and tried to debug it. Got the same exact error message.


Submitted On 05-FEB-2007
netrice I get this error also...


Submitted On 10-FEB-2007
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 first use JDK6.0 to debug my program,but it shown me above, sign


Submitted On 18-FEB-2007
Orclev still showing up in 1.6.0-b105
reproduced using MyEclipse Enterprise Workbench 5.5.0 Milestone 1 and Maven 2.0.5
Exact error is same as posted previously, but I'll repost for clarity:
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]


Submitted On 18-FEB-2007
Orclev Still in 1.6.0-b105 JDK on WindowsXP
Was able to reproduce it using Maven 2.0.5, so it seems to be related to any sort of debuger, specificly it occurs during the test phase of the Maven build. Exact error follows:
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]


Submitted On 12-MAR-2007
I made a console program with JDI and worked it on JDK1.4 and JDK1.5 without problems. But on JDK1.6, same message is sometimes found (not always).
--
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]
--
My environment is:
- JDK1.6 (build 1.6.0-b105)
- Windows XP SP2


Submitted On 15-MAR-2007
Eu tambem tive esse erro


Submitted On 16-MAR-2007
joejoes75 Me Too!


Submitted On 17-MAR-2007
same here


Submitted On 17-MAR-2007
tried with JDK1.5, no error


Submitted On 19-MAR-2007
prajzv1 same for me, netbeans 5.5, jdk1.6.0, WinVista


Submitted On 20-MAR-2007
Same here, fixed it.
Had a JFrame in my package without showing it.

Original:
    public static void main(String[] args) {
        // TODO code application logic here
    }

Fixed:
    public static void main(String[] args) {
        // TODO code application logic here
        frameMain fm = new frameMain();
        fm.setVisible(true);
    }


Submitted On 23-MAR-2007
my workaround...

Original:   
public static void main(String[] args) {
        System.out.println("test");
}

Workaround:
    public static void main(String[] args) {
        System.out.println("test");
        System.exit(0);
    }


Submitted On 04-APR-2007
andig2 Still present in 1.6.0_01 U1


Submitted On 07-APR-2007
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]


Submitted On 11-APR-2007
Getting this on my Maven projects in Eclipse using Java 6u1, which is preventing my company to adapt Java 6. Same error message as above.


Submitted On 15-APR-2007
me too
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]


Submitted On 04-MAY-2007
Me too.
I'm trying to programme with Berkley DB,then it occurred.


Submitted On 04-MAY-2007
When will this bug be fixed?
Since last year SEP


Submitted On 04-MAY-2007
Me too.
I'm trying to programme with Berkley DB,then it occurred.


Submitted On 11-MAY-2007
eating Yeah, I met with the same problem in eclipse 3.2.2 win32
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]


Submitted On 31-MAY-2007
cigxw same error; latest java 1.6.0_01-b06; win xp sp2


Submitted On 01-JUN-2007
belgampaul it happens sometimes while debugging a project. Some projects are debugged with no problems, in others it is quite random. Sometimes debugging works, sometimes not.


jdk 1.6
netbeans 6.0(M9)


Submitted On 01-JUN-2007
belgampaul Thanks for the workarounds. None of them don't work with Netbeans 6.0(M9), jdk 1.6.

I was able more less to find the workaround in Netbeans though. I just refactor the class the doesn't submit the first breakpoint.

I've already encountered some weird stuff with the netbeans refactoring but this one is just too weird.


Submitted On 27-JUN-2007
DJnZ got it too..
Eclipse SDK
Version: 3.2.2
Build id: M20070212-1330
java.runtime.version=1.6.0_01-b06


Submitted On 10-JUL-2007
The same error:
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'm using Eclipse 3.2.1 running on JDK 1.6.0_02 and this error occures when I finishing debugging my app.


Submitted On 14-JUL-2007
Error AGENT_ERROR_NO_JNI_ENV solution
Workaroud (works for me):
I've make this workaround based in info in this.
Somebody said this could be a timing problem for short programs, so put somewhere in main(...) beginning this code:

    try
    {
      Thread.sleep(100);
    }
    catch(Exception e)
    {}


Submitted On 22-JUL-2007
try to remove all the breakpoints and then to add breakpoints if it's needed.
I had the same message and it doesn't appear anymore!


Submitted On 17-AUG-2007
Same is here
jdk 1.6.0_02
Eclipse 3.3 _Maven Plugin


Submitted On 28-AUG-2007
What happens if you use JDK instead of JRE? Is the message still shown?


Submitted On 10-SEP-2007
Got the same error..
Eclipse
jdk 1.6.0_02


Submitted On 06-OCT-2007
Same here
jdk 1.6.0u2
eclipse 3.3.1


Submitted On 11-OCT-2007
Same issue here:

Product Version: NetBeans IDE 6.0 Beta 1 (Build 200709141330)
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)


Submitted On 22-OCT-2007
I just encountered this error, and its driving me crazy, i cant compile my project anymore! isnt there ANY workaround??

Eclipse Version: 3.3.0
Build id: M20070921-1145

JDK 1.6.0_03


Submitted On 28-OCT-2007
As andig2 noted, adding "System.exit(0)" is a very good workaround.


Submitted On 12-NOV-2007
Has someone finally found any kind of workaround?


Submitted On 17-NOV-2007
facing the same issue


Submitted On 30-NOV-2007
Happened on jdk1.6.0_03 netbeans 6.1 rel.29-11-07 in search for icon by image chooser in debugging jswing. 30 nov 07
shahrokh


Submitted On 06-DEC-2007
DiGiTaL_FuRy I am using java 1.6.0_02 on XP Pro
I keep getting it and I don't know why. I took out all my break points and it still happens.

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]


Submitted On 01-JAN-2008
I got this problem, too. But the run function can not work anymore.
Environment: Eclipse 3.2.2 + JRE 1.6

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]


Submitted On 01-JAN-2008
I got this problem,too. Eclipse 3.2.2 + JRE 1.6


Submitted On 05-JAN-2008
I got this problem, too. But the run function can not work anymore.
Environment: Eclipse 3.2.2 + JRE 1.6

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]


Submitted On 28-JAN-2008
Exekutor Exact same problem here

EasyEclipse Server Java
Version: 1.2.2.2
Based on Eclipse build id: M20070212-1330

java version "1.6.0_03"

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]

 

PLEASE NOTE: JDK6 is formerly known as Project Mustang
 

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 新房子装修效果图 室内简单装修效果图大全 儿童卧室装修效果图小户型 小户型装修效果图大全2015图片 楼中楼装修效果图小户型 三室两厅装修效果图现代简约 现代装修风格效果图客厅 简约客厅装修实景图大全 90平方米简约装修效果图 190平方房子装修效果图 8平米卫生间装修效果图 100平方房屋装修效果图 四室两厅两卫装修效果图 130平米三室两厅装修效果图 八十平米小户型设计效果图 三室一厅一厨一卫装修效果图 七十平米小户型装修效果图 200平方米的房子设计图 75平方两室一厅装修效果图 113平方三室两厅装修效果图2015 85平米两室一厅装修效果图 四十平米小户型装修效果图 三房两厅两卫装修效果图 现代简约客厅装修效果图 3平方米卫生间装修效果图 主人房卫生间装修效果图 110平米三室两厅装修效果图 30平米单身公寓装修效果图 现代简约风格装修效果图 65平米小户型装修效果图大全 家装评选 装修帮登陆 家装帮 东易日盛全屋定制家装 东易日盛家装怎么样 柠檬树家装 柠檬树家装公司 家装循环水正规做法 家装循环水的做法图片 家装水电工 我要招聘家装水电工2名