Subject: Help (Java) !....
Posted By: Gika Post Date: 3/29/2004 5:03:43 PM
Always when I try to run a Java Program a get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: <the class Name>


Thanks Gika

Reply By: Martyn Reply Date: 3/29/2004 5:17:33 PM
This error means that your classpath is not set up correctly.

Cheers

Martyn
Reply By: partho_choudhury Reply Date: 4/2/2004 11:07:30 AM
ya, check with running the java/javac commands (without arguments) in the command line from an arbitrary path. If these commands are not recognized from all the paths, then your path variables have not been correctly set, and need to be done so.

Partho
Reply By: wujie Reply Date: 4/10/2004 2:25:10 AM
If your program has not got the right 'main' method or has no the
'main' method this error will occur though you compile it well.

cheers

wujie

Reply By: zhiwen Reply Date: 6/14/2004 2:35:58 AM
do sent some piece of code if u can. i believe a lot of member can help look into it.

Reply By: gokul_blr Reply Date: 7/29/2004 7:17:01 AM
Check the mismatch of case between the java program/class name and in the command prompt invoking name

like   "HelloWorld.class"    is the class name  and java file name should be "HelloWorld.java"

and command line parameters of execution should be "java HelloWorld"

ext. java to Java may also produce this error


Reply By: sillyu Reply Date: 8/27/2004 10:23:34 AM
you don't set your classpath and path collectly ,in windows ,if your jdk is instanlled in c:\j2sdk1.4.0.you can set your path c:\j2sdk1.4.\bin;.
don't forget .it means your computer will find command in your
currently path .
then you set classpath refer to the class file you make .


Reply By: olupas Reply Date: 9/24/2004 12:08:40 PM


Watch out for the package....of course after set your classpath and path collectly in autoexec.bat or under windows XP in Envoirement Variables
(wright click MyComputer\Properties\Advanced)



Go to topic 19568

Return to index page 765
Return to index page 764
Return to index page 763
Return to index page 762
Return to index page 761
Return to index page 760
Return to index page 759
Return to index page 758
Return to index page 757
Return to index page 756