java.lang.NoClassDefFoundError: while resolving class
Hello All,
I get the following error when running the Java program, the program compiles without any problem:
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class
: PPDSBackEnd.PPDSCmdLineParser
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.
5.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
at CPPDSScheduler.main(java.lang.String[]) (Unknown Source)
Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found i
n [file:/usr/share/java/libgcj-3.4.3.jar, file:./, core:/]
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.
0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj
.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgc
j.so.5.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.
0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.5.0.0)
at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)
at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)
at _Jv_PrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at _Jv_WaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.
0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.
5.0.0)
...2 more
It is giving an error at the line where I import my own java Package:
import PPDSBackEnd.PPDSCmdLineParser;
I have created a folder PPDSBackEnd under the current folder from where I am running the Java program.
All the .class files (that belong to PPDSBackEnd) are in the path: .\PPDSBackEnd
While compiling the .java programs that belong to PPDSBackEnd package I am using
Javac -d . <program.java>
The compiler places all the .class files correctly in the folder \PPDSBackEnd.
I tried removing all .class files and compiling again, but still it gives the same error.
This program runs fine on one Linux server, but fails on another. The other Linux server has the latest JDK installed.
Please help.
Thanks,
Vaibhav

