• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

NoClassDefFound

S

SpeedRunner

Guest
I have recently installed new editions of both JDK and Textpad. My programs seem to compile fine, but when I try to run the programs it gives me a command prompt screen that says:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: InnerClassTest 
Press any key to continue...

InnerClassTest is the name of the program, but I have tried multiple programs that I know for sure work. Again, it seems to compile fine but it will not run the programs.

I remember having this issue before and I forgot how to fix it. I believe I had to set either the PATH or CLASSPATH under System > Advanced > Environment Variables.

This is what I have PATH set as:
C:\Program Files\Java\jdk1.5.0_08\bin

This is what I have CLASSPATH set as:
C:\Program Files\Java\jre1.5.0_08\bin

Now unless I'm making a mistake, those both look right to me. I can't find any clear awnsers on what might be wrong, been searching the web for hours now.
 
Java's telling you that, in the CLASSPATH, it cannot find that class. Therefore, amend the classpath to where the class would be found.
 
Tawnos said:
Java's telling you that, in the CLASSPATH, it cannot find that class. Therefore, amend the classpath to where the class would be found.

Well I figured that. In my post I had the directory that it is currently set to. I do not know where to amend the classpath to.
 
In textpad there's an option for the java commandline args. $FileDir is the current directory. So you'd change the command to "java -cp $FileDir ...plus the rest that was there.
 
444 said:
In textpad there's an option for the java commandline args. $FileDir is the current directory. So you'd change the command to "java -cp $FileDir ...plus the rest that was there.

This isn't a textpad issue actually, I have the same error when typing in "java InnerClassTest" even though the class file is clearly in that directory. Keep in mind, I have done fresh installs of JDK and Textpad.
 
Speedrunner, did you see my post? Add the location of the class to your CLASSPATH. Might want to add . there, also
 
Back
Top