cmd を使用して、easyflow-gui.jar という名前の 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: フォルダーを確認して jar を抽出したところ、両方のクラスが利用可能であることがわかりました (作業ディレクトリ内のそれぞれの jar にバンドルされています)。
$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