Exception in thread "main" java.lang.NoClassDefFoundError: TestConWindow Uggghhhh! This program worked fine until today!!! It must be a Classpath thing, but I can't figure it out. The class compiles fine but then receives this error when I try to execute. Could this message be any LESS helpful? Here is the code. The 'User' class is in the same directory as the TestConWindow.class ... I had a classpath problem with this last week which I got around by compiling with -classpath. That is the only way I could get the program to compile and adding .; to my classpath does not work.
Thanks if anyone can help. Pulling my hair out... ------------------ I'm a soldier in the NetScape Wars... Joel
Wait a minute, I'm trying to think of something clever to say...<p>Joel
In your code, you are specifying that your TestConWindow is in the camra2 package... if you are in the same directory as the class file, try running it this way :
You have to specify the directory directly before the beginning of your package in the classpath, and if a class is a member of a package, you have to specify it's full name (i.e. full package path + class name) on the command line.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Mar 23, 2001
I've removed the package reference. Both Classes are in the same directory. They both compiled fine. My classpath includes the current directory. I tried running the program without -classpath and with -classpath. No matter what I receive the same error:
I don't know what else to do, I don't see anything wrong with the code (same as above w/o package statement), "main" obviously exists, I'm not running the program with ".java" extension, my classpath is set and complete. Going bald... ------------------ I'm a soldier in the NetScape Wars... Joel
I've been trying to test your code and there doesn't look like there should be any problem... the only suggestion I can make is to check out the logic in the Class.forName related stuff... in the spoofed User class I made to test your code, if I was returning bogus info ( i.e. a class that did not exist ), I got a similiar error message... strangely, you should not get that error message if you were making the same mistake I was, because the TestConWindow class obviously exists....
Sorry I couldn't help more...
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Exception in thread "main" java.lang.NoClassDefFoundError: TestConWindow