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]

请在代码最后加入以下语句:System.exit(0)即可(在main函数结束时,添加system.exit(0);),

注意,只需要在这种情况下加,在正式运行时不需要。

补充说明:

return 和 system.exit()有什么区别:

1.return是返回程序上一层,system.exit()是返回程序最上层

2.return中断当前方法,system.exit()中断整个程序,应该是关闭JVM了

转自:http://blog.csdn.net/config_man/archive/2010/03/17/5390831.aspx

http://apps.hi.baidu.com/share/detail/22479756

相关文章:

  • 2021-08-06
  • 2021-10-27
  • 2021-11-11
  • 2021-11-28
  • 2021-11-10
  • 2021-06-05
  • 2021-07-10
  • 2021-09-01
猜你喜欢
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-05-21
相关资源
相似解决方案