Set up or Installation Problems

On office PC running Windows 2000 Professional, I had JDK1.3.0, Microsoft J++, and Forte for Java installed. Yesterday, I installed JDK1.4.0 and set the path/classpath in the environment variables. A small "test" program that compiles and runs on my home PC (Win98 with JDK1.3.0, J++, Forte for Java), will compile on the office PC, but when I go to run it, I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: test

The program is named "test". Any known solutions? Should I have uninstalled JDK1.3.0 first?

Please help...

[587 byte] By [bosley] at [2007-9-26 5:41:11]
# 1
This problem is occuring because the class cannot be found in the classpath. If you make sure you are running the class from the directory it is in and one of the two following solutions should work:1. java -cp . test2. Make sure . is in the classpath.
AlasdairN at 2007-7-1 13:57:10 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2

Thank you, very much. Typing

java -cp the_classpath test

did work. However, if possible, I want to correct whatever the problem is. I didn't have to include -cp the_classpath when I compiled it, and I was both running and compiling it from the same directory.

Any ideas? Thanks, again.

bosley at 2007-7-1 13:57:10 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 3

Your first post said you set the classpath. I assume you mean you edited the autoexec.bat file to include a line that sets the classpath. If java -cp the_classpath works, then you didn't set the classpath in autoexec.bat to include the_classpath. Something like:

set Classpath=the_classpath;%classpath

atmguy at 2007-7-1 13:57:10 > top of Java-index,Archived Forums,New To Java Technology Archive...