Help about JST [message #638956] |
Sat, 13 November 2010 21:57 |
Kam Ng Messages: 13 Registered: November 2010 Location: Hong Kong |
Junior Member |
|
|
Hello,
I got a problem when I was trying to use the AST, here is the code,
protected CompilationUnit parse(char[] sourceArray) {
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setSource(sourceArray);
parser.setResolveBindings(true);
return (CompilationUnit) parser.createAST(null);
}
I got the error below:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/resources/IResource
at org.eclipse.jdt.core.dom.ASTParser.<init>(ASTParser.java:176)
at org.eclipse.jdt.core.dom.ASTParser.newParser(ASTParser.java: 125)
at Analyzer.parse(Analyzer.java:96)
at Analyzer.analyzing(Analyzer.java:55)
at API_RM.main(API_RM.java:7)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.resources.IResource
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more
I have already include the JDT variable(List below) by adding the external variable and also the "org.eclipse.equinox.common_3.6.0.v20100503.jar" from ECLIPSE_HOME. Am I missing something? Why I got the problem?
Please help me out to get this done.
Thanks for your help in advance.
Regards,
Kam
External variable added
org.eclipse.ant.launching_1.0.0.v20100427.jar
org.eclipse.ant.ui_3.5.0.v20100427.jar
org.eclipse.jdt.apt.core_3.3.401.R36_v20100727-0110.jar
org.eclipse.jdt.apt.pluggable.core_1.0.301.R36_v20100727-011 0.jar
org.eclipse.jdt.apt.ui_3.3.300.v20100513-0845.jar
org.eclipse.jdt.compiler.apt_1.0.300.v20100513-0845.jar
org.eclipse.jdt.compiler.tool_1.0.100.v_A68_R36x.jar
org.eclipse.jdt.core.manipulation_1.3.0.v20100520-0800.jar
org.eclipse.jdt.core_3.6.1.v_A68_R36x.jar
org.eclipse.jdt.debug.ui_3.5.0.v20100602-0830.jar
org.eclipse.jdt.debug_3.6.1.v20100715_r361.jar
org.eclipse.jdt.doc.user_3.6.1.r361_v20100721-0800.jar
org.eclipse.jdt.junit.core_3.6.1.r361_v20100825-0800.jar
org.eclipse.jdt.junit.runtime_3.4.200.v20100526-0800.jar
org.eclipse.jdt.junit_3.6.1.r361_v20100825-0800.jar
org.eclipse.jdt.junit4.runtime_1.1.100.v20100526-0800.jar
org.eclipse.jdt.launching.macosx_3.2.100.v20100505.jar
org.eclipse.jdt.launching.ui.macosx_1.0.100.v20100505.jar
org.eclipse.jdt.launching_3.5.100.v20100526.jar
org.eclipse.jdt.ui_3.6.1.r361_v20100825-0800.jar
org.eclipse.jdt_3.6.1.v201009090800.jar
org.hamcrest.core_1.1.0.v20090501071000.jar
org.junit_3.8.2.v3_8_2_v20100427-1100.jar
org.junit_4.8.1.v4_8_1_v20100427-1100.jar
org.junit4_4.8.1.v20100525.jar
[Updated on: Sat, 13 November 2010 21:59] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04092 seconds