0
將java源代碼傳遞給下面提到的代碼時,我收到一個異常,並不知道如何解決此問題。 Kindlly讓我知道我錯了/任何替代解決方案...'java.lang.NoSuchFieldError:ignoreMethodBodies'創建AST時出現異常
源代碼:
char[] source = resultEntryIndustry.text.toCharArray();
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(source);
Map options = JavaCore.getOptions();
JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options);
parser.setCompilerOptions(options);
CompilationUnit cUnit = (CompilationUnit) parser.createAST(null);
拋出異常:
Exception in thread "main" java.lang.NoSuchFieldError: ignoreMethodBodies
at org.eclipse.jdt.core.dom.CompilationUnitResolver.parse(CompilationUnitResolver.java:491)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1194)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:801)
at itjava.model.CompilationUnitStoreIndustry.createCompilationUnitFacadeList(CompilationUnitStoreIndustry.java:71)
at itjava.presenter.WordInfoPresenterIndustry.SetCompilationUnitListAndAccessRepository(WordInfoPresenterIndustry.java:162)
at itjava.industry.code2String.main(code2String.java:31)
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]
解析的源代碼是用一個簡單的java文件使用JDBC連接到數據庫。
請參考前面的問題。它可能有幫助。 [http://stackoverflow.com/questions/2225737/error-jdwp-unable-to-get-jni-1-2-environment][1] [1]:HTTP: //sackoveroverflow.com/questions/2225737/error-jdwp-unable-to-get-jni-1-2-environment – 2012-04-02 06:46:51
qn。你貼的是完全不同的這個..錯誤的聯繫也許。 – iRiddler 2012-04-05 23:18:36