eclipse デバッグでエラー
2011/03/14
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]
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]
JREの設定とか色々とあるみたいだけど、私の場合はインストした際に「HellowWorld」の出力プログラムをコピペしたんだけどそこに「System.exit(0);」を追加でOK。
最初はこんな感じ。
- package hoge.hoge.com;
- public class HellowWorld {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO 自動生成されたメソッド・スタブ
- System.out.println("Hellow Java World!");
- }
- }
修正したものは下記のような感じ。
- package hoge.hoge.com;
- public class HellowWorld {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO 自動生成されたメソッド・スタブ
- System.out.println("Hellow Java World!");
- System.exit(0);
- }
- }
参考にしたサイトにも書いてるけど2回目以降は「System.exit(0);」がなくてもよさげ。他の新規プロジェクトのときが大丈夫かは不明。
■情報元:はなとゆめ – JDK1.6で妙なエラー