Status
Not open for further replies.
hi ! I am using jdk 1.5 but I am not able to execute any of the program. Program gets compiled but when I try to run the program it gives :
Exception in thread "main" java.lang.NoClassDefFoundError: First
I also tried j2sdk1.4.1_01 but the problem remains the same.
 

redhat

Mad and Furious
The following information may be usefull :
Popular Error Encountered: Some times you may encounter
an error during the execution of program.
Exception in thread “main” java.lang.NoClassDefFoundError:
filename
Solution
Go to control panel -> System -> Click on Advanced Tab then
on “Environments Variables”
Double click on classpath and specify this path —
.;c:\Progra~1\Java\jdk1.5.0\jre\lib\rt.jar;c:\progra~1\Java\jdk1
.5.0\lib\dt.jar
This is taken from Nitish Upreti's Book for Beginners.
Maybe It can help you...
 

Pathik

Google Bot
This error most commonly occurs when you try to run the compiled program using
Code:
java file.class
or
Code:
java file.class

Or if there was an error while compiling.

If it compiled correctly use

Code:
java file
 

ruturaj3

Journeyman
May be in ur code ur class name is Sample,
And u hv save the file with sample.java.

In java, class name & file name must be same(case sensitive).
 

redhat

Mad and Furious
that cant be cuz he is able to javac

post the code here.

Yes, You maybe be able to compile, but the class wont execute.
Has'nt it been said, "during execution"??
This does work, thanks to nitish_mythology (on this forum)
 
Status
Not open for further replies.
Top Bottom