File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Exception in thread "main" java.lang.NoClassDefFoundError: Test" Watch "Exception in thread "main" java.lang.NoClassDefFoundError: Test" New topic
Author

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

kalaiyarasan sivaprakasam
Greenhorn

Joined: Aug 17, 2009
Posts: 29
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

Joined: Aug 17, 2009
Posts: 29
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

Joined: Mar 04, 2009
Posts: 471
Please use Code Tags for posting codes and keep away from IDE's when you are starting off!
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

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.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Exception in thread "main" java.lang.NoClassDefFoundError: Test
 
Similar Threads
package problem
class accessibility
Exception in thread main() error
NoSuchClassFound exception
JAR file problem