当我尝试运行jar文件时获取java.lang.NoClassDefFoundError

时间:2012-05-16 23:44:51

标签: java jar classpath noclassdeffounderror buildr

我构建了一个jar文件(带有buildr),它看起来都不错但是当我尝试运行它时,我得到了一个错误的错误。

$java -Djava.library.path=./ -jar Splat-0.0.0.jar
Exception in thread "main" java.lang.NoClassDefFoundError: com/digitaltea/splat/Splat
Caused by: java.lang.ClassNotFoundException: com.digitaltea.splat.Splat
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: com.digitaltea.splat.Splat. Program will exit.

这是我的清单文件。

Created-By: Buildr
Manifest-Version: 1.0
Implementation-Version: 
Implementation-Title: Splat Text Editor
Build-Jdk: 
Main-Class: com.digitaltea.splat.Splat
Build-By: christian
Class-Path: swt.jar libnet_sf_colorer.so xmlwise-1_1-r9.jar colorer.jar jspf.core-.0.2.jar

这是我的jar文件结构。

$jar tf Splat-0.0.0.jar
META-INF/
META-INF/MANIFEST.MF
com/
com/digitaltea/
com/digitaltea/splat/
com/digitaltea/splat/Splat.class
com/digitaltea/splat/core/
com/digitaltea/splat/core/CoreAPI.class
com/digitaltea/splat/core/coreplugin/
com/digitaltea/splat/core/coreplugin/Core.class
com/digitaltea/splat/core/coreplugin/DocumentTab$1.class
com/digitaltea/splat/core/coreplugin/DocumentTab.class
com/digitaltea/splat/core/coreplugin/NewTabEvent.class
com/digitaltea/splat/core/coreplugin/NewTabListener.class
com/digitaltea/splat/core/coreplugin/TabbedEditor$1.class
com/digitaltea/splat/core/coreplugin/TabbedEditor.class
com/digitaltea/splat/plugins/
com/digitaltea/splat/plugins/PluginAction.class
com/digitaltea/splat/plugins/SplatAPI.class 

有什么想法吗?

0 个答案:

没有答案