[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: ASTParser Help

I tried your example, and I get this error. I'm using jar files from eclipse 3.2.2.

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/Plugin
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at org.eclipse.jdt.core.dom.ASTParser.initializeDefaults(ASTParser.java:230)
at org.eclipse.jdt.core.dom.ASTParser.<init>(ASTParser.java:212)
at org.eclipse.jdt.core.dom.ASTParser.newParser(ASTParser.java:112)
at test.Test.main(Test.java:23)




Fayezin Islam wrote:
Many thanks for your replies. It really helped a lot!

Now that I have added the requred jars, I am able to create a CompilationUnit object from the source code.

I dont know how to extract the method & parameter names & variable names from a CompilationUnit object.

Please advice how can I do it.

Thanks & Regards,

Fayezin


"Olivier Thomann" <olivier_thomann@xxxxxxxxxx> wrote in message news:eqojka$9ki$1@xxxxxxxxxxxxxxxxxxxx
Fayezin Islam a écrit :
I get this error during compilation (maybe its asking for the runtime?)-
The type org.eclipse.core.runtime.IProgressMonitor cannot be resolved. It is indirectly referenced from required .class files I am using the org.eclipse.jdt.core_3.2.1.v_677_r32x.jar in my buildpath.
If its the wrong one, please advise which one to use?


Can you please help me solve this problem?
It can run inside a standalone application as long as you are not using Javamodel element (IJavaProject, ICompilationUnit).
Even if you don't use any java element, you need to put some jars on the classpath in order to find some classes required to resolve some signatures.
--
Olivier