Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in thread "main" java.lang.NoClassDefFoundError: Test

 
kalaiyarasan sivaprakasam
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

class Test {
public static void main(String ars[]) {

System.out.println("this is example program");
}
}



i could not figure out what is the problem in my system,
the problem is i am not able to run this program in DOS ,i could do in Eclipse.


Even i have set the path in environment as
path
C:\bea\jdk150_11\bin
JAVA_HOME
C:\bea\jdk150_11

Still i am getting Exception in thread "main" java.lang.NoClassDefFoundError: Test


could you please help me some one


With Regards,
Kalai.

 
kalaiyarasan sivaprakasam
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,


I got where i did the mistake,

in environment variable

CLASS_PATH

i did not give . symbol so now i have added its working fine..

With Regards,
Kalai.
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use Code Tags for posting codes and keep away from IDE's when you are starting off!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kalaiyarasan sivaprakasam wrote:...in environment variable

CLASS_PATH

i did not give . symbol so now i have added its working fine...

Unless you need a system classpath for somehing else, it's best to not have a classpath set at all. Otherwise, yes, it should include a dot for the current directory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic