javascript异常NoClassDefFoundError:RegistryFactory的ASTparser
我正在尝试使用ASTparser来解析javascript。当我运行代码时:javascript异常NoClassDefFoundError:RegistryFactory的ASTparser,java,javascript,eclipse,Java,Javascript,Eclipse,我正在尝试使用ASTparser来解析javascript。当我运行代码时: ASTParser parser = ASTParser.newParser(AST.JLS3); parser.setSource(source.toString().toCharArray()); parser.setKind(ASTParser.K_COMPILATION_UNIT); 我得到这个错误: Exception in thread "main" java.lang.NoClassDefFoundE
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(source.toString().toCharArray());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
我得到这个错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/RegistryFactory
at org.eclipse.core.internal.runtime.InternalPlatform.getRegistry(InternalPlatform.java:556)
at org.eclipse.core.runtime.Platform.getExtensionRegistry(Platform.java:919)
at org.eclipse.wst.jsdt.core.infer.InferrenceManager.loadInferenceExtensions(InferrenceManager.java:155)
at org.eclipse.wst.jsdt.core.infer.InferrenceManager.getInferenceProviders(InferrenceManager.java:63)
at org.eclipse.wst.jsdt.core.infer.InferrenceManager.getInferenceEngines(InferrenceManager.java:103)
at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.initializeInferenceEngine(Parser.java:6048)
at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.parse(Parser.java:6014)
at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.parse(Parser.java:5988)
at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.dietParse(Parser.java:4593)
at org.eclipse.wst.jsdt.core.dom.JavaScriptUnitResolver.parse(JavaScriptUnitResolver.java:406)
at org.eclipse.wst.jsdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:880)
at org.eclipse.wst.jsdt.core.dom.ASTParser.createAST(ASTParser.java:647)
我将
org.eclipse.core.runtime
添加到项目中,但它没有修复错误。我修复了问题:只需将org.eclipse.equinox.registry
jar文件添加到项目中