I'm trying to run a java program from a jar file. Java can't find a supporting marc4j class. What am I doing wrong. Here are the details
Within my current directly is MarcTry.jar
which has my main class. There is also marc4j.jar which has the missing class:
org/marc4j/MarcReader
For example:
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.
I've tried
java -jar MarcTry.jar -classpath marc4j.jar
with and without the marc4j.jar a fully qualified path.
Any ideas are welcome.