I am trying to use JaCoP in an Eclipse project. I have imported the libraries and it appears in the build path, the application compiles fine, but when it gets to the point where the library is required I get the following error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jdom/Content
at layout.MainLayoutManager.<init>(MainLayoutManager.java:14)
at gui.Instance.<init>(Instance.java:48)
at handler.Main.createNewInstance(Main.java:59)
at handler.Main$2.actionPerformed(Main.java:111)
The code that causes the error is
package layout;
import graph.Cell;
import graph.Vertex;
import interfaces.LayoutManager;
import java.util.ArrayList;
import JaCoP.core.Store;
public class MainLayoutManager implements LayoutManager {
ArrayList<CPVertex> vertexList = new ArrayList<CPVertex>();
Store store = new Store();
public MainLayoutManager() {
}
public void sortGraph(Cell[] cells) {
for (int i=0; i<cells.length; i++) {
if (cells[i].getType() == Cell.VERTEX) {
vertexList.add(new CPVertex((Vertex) cells[i]));
}
}
}
}
Specifically, the line
Store store = new Store();
I would really appreciate any help solving this error.
This just means that the particular class is missing in the runtime classpath (while it was available in the compiletime classpath, that’s the difference with
ClassNotFoundException).Logical next step would be to include the particular class (or more actually, the JAR file with the particular class) in the runtime classpath. Then this error wil gone.
Check your compiletime classpath if it is there and add it to runtime classpath. Or if it is actually a runtime dependency which you don’t have yet (which is likely the case 😉 ), then it’s good to know that the package name already hints that you can find and download it at http://jdom.org.