添加库后获取java.lang.NoClassDefFoundError

时间:2015-02-28 23:51:46

标签: java

我已下载Java code并尝试在提供there的示例上启动它。特别是我从主目录运行java edu.toronto.cs.propagation.ic.ICEstimate -m 50 -d 1e-8 -s data/memeS.sn -i data/memeS.out -o data/memeS.probs。但是,我收到以下消息:

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)

我已将CLASSPATHPATH指定为:

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"  

我的javalib文件夹中有jsap库。

可能是什么问题?我该如何运行代码?

0 个答案:

没有答案