samedi 28 février 2015

Get java.lang.NoClassDefFoundError after adding library



I have downloaded java code and try to launch it on examples that are provided there. In particular I run java edu.toronto.cs.propagation.ic.ICEstimate -m 50 -d 1e-8 -s data/memeS.sn -i data/memeS.out -o data/memeS.probs from the main directory. However, I get the following message:



Exception in thread "main" java.lang.NoClassDefFoundError: com/martiansoftware/jsap/StringParser
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: com.martiansoftware.jsap.StringParser
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)


I have specified CLASSPATH and PATH as following:



export PATH="/home/sergey/miniconda/bin:$PATH" export CLASSPATH="/home/sergey/workspace/Spine/javalib/:$CLASSPATH" export CLASSPATH="/home/sergey/workspace/Spine/spine.0.1.jar:$CLASSPATH"



and I have jsap library in my javalib folder.


What can be the problem? How can I run the code?




Aucun commentaire:

Enregistrer un commentaire