我正在尝试从jar文件运行
java程序.
Java找不到支持marc4j的类.我究竟做错了什么.这是详细信息
在我当前的直接是MarcTry.jar,它有我的主要课程.还有marc4j.jar,它有缺少的类:
org/marc4j/MarcReader
例如:
java -jar MarcTry.jar
Exception in thread “main” java.lang.NoClassDefFoundError: org/marc4j/MarcReader
Caused by: java.lang.ClassNotFoundException: org.marc4j.MarcReader
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: marctry.Main. Program will exit.
我试过了
java -jar MarcTry.jar -classpath marc4j.jar
有和没有marc4j.jar一个完全限定的路径.
欢迎任何想法.