Hi, Im using j2sdk1.4.2_04 in WinXP. this is my simple class for testing this new version since before I used j2sdk1.4.0; Ive installed this new version after uninstalling the 1.4.0 completly and after restarting my comp as well. this works fine whin I compile and run it in j2sdk1.4.2/bin dir but its not working but only compiling when I put it in any other place,say just in C drive.
I went through the web for get a solution but failed. it may be somthing wrong with my paths but still I couldnt findout.
here are my environment variables.(system variables) ==========================================================
I gather you are getting a 'Bad command' error or something like that? If so, my suggestion would be to put C:\j2sdk1.4.2\bin into your PATH environment variable. You will then be able to run the various java executables from any directory at the command prompt.
Sorry, I should have been a little more specific on the exact path value. For instance, I am using Java 1.4.2_02 and the default installation directory is c:\j2sdk1.4.2_02. Perhaps you should update the path statement to be the exact installation directory (assuming you took the default install which I assume would put it in c:\j2sdk1.4.2_04)?
Ive done the same thing with folder name j2sdk1.4.2_04 at the beginning but the result was same.Now I've replaced JAVA_HOME with C:\j2sdk1.4.2_04\bin int the path and the CLASSPATH.I've created a user variable as JAVA_HOME and gave C:\j2sdk1.4.2_04\bin. But the result was same. Ive been stucked with this problem for two days but still the situation is same. anyway thanx a lot for your help. regs, Jil
Can you provide the exact command you are typing in? I reread the thread and don't believe that it is related to path issues but perhaps the way in which you are calling your java application. Typically the NoClassDefFoundError occurs when you try something like the following (assuming the class name is Test1):
java Test1.java or java test1.java or java Test1.class
In other words, it is trying to load a class file that it can't find. In your case the exact command should be: java Test1
If you are still getting the same error, my guess is that it still cannot locate the Test1.class file on your harddrive which would lead me back to path issues again. Give it a try and post the response (exactly what you typed and from where).