Reason And Sol for ERROR "java.lang.NoClassDefFoundError "

4 views
Skip to first unread message

nitin...@yahoo.com

unread,
May 27, 2005, 5:28:14 AM5/27/05
to giGA...@googlegroups.com
I have downloaded j2sdk1.4.2_08 and installed on my computer. The
installtion run succesfuly and dir name j2sdk1.4.2_08 is created on c
drive. I had written simple java program and compile, It cmpile but
when I run using "java Program_name" at dos prompot it give error
"Exception in thread "main" java.lang.NoClassDefFoundError: "
what is prob.

what are other reason for this type of error.

and also tell what is difference between j2sdk and jdk installation

thanks

nitin...@yahoo.com

unread,
May 27, 2005, 5:42:55 AM5/27/05
to giGA...@googlegroups.com
Both Installation are same.
And about Error, This error will come the class path is not set . u
need to set the class path or else when running the program normally at
DOS prompt run it as prompt> java -classpath c:\JAVA_DIR_NAME\lib\

the last syntax is effective when when ur r not able to set environment
variables.

Nishant Sonar

unread,
May 27, 2005, 9:45:38 AM5/27/05
to giGA...@googlegroups.com

 
switch to the directory wher the progranm lies (rather the class file u compiled to lies ) and try running it again.
alternately u can switch to

path=c:\myprogs

and try

Nishant Sonar
20, Tirupati Apartments,
Shivtirth Nagar,Paud Road
Kothrud, Pune(M.S.)
Mob:9823871676
Tel:020-25398002

Reply all
Reply to author
Forward
0 new messages