我試圖運行使用CMD命名easyflow-gui.jar罐子捆綁Java程序:找不到主類
java -classpath "." -jar easyflow-gui.jar
工作目錄是包含所有相關庫的目錄。
的jar文件我試圖運行的清單文件的內容是:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.3
Created-By: 1.6.0_32-b27 (Sun Microsystems Inc.)
Main-Class: easyflow.custom.jgraphx.editor.SchemaEditor
這種嘗試的結果是:
Exception in thread "main" java.lang.NoClassDefFoundError: com/mxgraph/util/mxEventSource$mxIEventListener
Caused by: java.lang.ClassNotFoundException: com.mxgraph.util.mxEventSource$mxIEventListener
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: easyflow.custom.jgraphx.editor.SchemaEditor. Program will exit.
問題:該類別中的一個實際上找不到:mxEventSource $ mxIEventListener或主類easyflow.custom.jgraphx.editor.SchemaEditor?
編輯1: 我檢查了文件夾,並提取了罐子,我覺得都可用類(捆綁到其各自的罐子在工作目錄):
$ls easyflow/custom/jgraphx/editor/SchemaEditor*
easyflow/custom/jgraphx/editor/SchemaEditor$1.class
easyflow/custom/jgraphx/editor/SchemaEditor$2.class
easyflow/custom/jgraphx/editor/SchemaEditor.class
easyflow/custom/jgraphx/editor/SchemaEditor.java
$ls com/mxgraph/util/mxEventSource*
com/mxgraph/util/mxEventSource$mxIEventListener.class
com/mxgraph/util/mxEventSource.class
不知怎的,我不知道如何將其納入其他比我:指定類路徑的地方,我的文件夾,然後將裝有類到該目錄罐子。 .. – user1240076
爲什麼不只是'java -jar easyflow-gui.jar'並且看看會發生什麼? –
我試過並給了我完全相同的錯誤/異常。 – user1240076