NoClassDefFoundError points to the wrong class.
Posted
by Sora
on Stack Overflow
See other posts from Stack Overflow
or by Sora
Published on 2010-05-07T15:45:09Z
Indexed on
2010/05/07
15:48 UTC
Read the original article
Hit count: 289
java
I'm validating the installation of a program that consists of a few separate modules. They are not co-dependent. I have apple.jar and orange.jar, they are placed in the same folder and were developed in the same project, but run independent of each other.
Running apple.jar goes fine, but orange.jar gives me a NoClassDefFoundError pointing to apple.jar.
/usr/java/jre1.6.0_14/bin/java -jar validator.jar
Exception in thread "main" java.lang.NoClassDefFoundError: orange/client/Apple Caused by: java.lang.ClassNotFoundException: orange.client.Apple at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Could not find the main class: validator/client/StormDataXMLGenerator. Program will exit.
The manifest file lists Orange as the correct main class.
Main-Class: orange/client/Orange
Anybody know why it's giving me the NoClassDefFoundError? Thanks in advance!
© Stack Overflow or respective owner