I am using a this project on the project that I am developing in Netbeans. Basically, I copied the 3 source code files to my project and did some tweaks to the Main.java
file in order for me to be able to use it in my project.
The compiler then said that package org.eclipse.jdt.core.compiler does not exist
for the following imports:
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.CompilationUnit;
I tried to add the module dependency by going to Project Properties
> Libraries
> Module Dependencies
> Add
and typing org.eclipse.jdt.core.compiler
but no library was found. Usually, the available libraries are shown as one types their name. In this case, none was shown.
So, I downloaded org.eclipse.jdt.core
jar from here and added it to the project by going to Project Properties
> Libraries
> Wrapped JARs
> Add JAR
. The compilation errors disappeared and I was able to run the project.
However, when the line ASTParser parser = ASTParser.newParser(AST.JLS3);
is reached, the following exception is thrown.
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/resources/IResource
I am supposing that this exception and the fact that I couldn't find the library in the module dependecies in Netbeans are related.
Does this mean that I cannot use org.eclipse.jdt.core
in Netbeans or is there another problem? Can someone help me?