This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
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: 477
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://aspose.com/file-tools
 
subject: Exception in thread "main" java.lang.NoClassDefFoundError: Test
 
Similar Threads
NoSuchClassFound exception
Exception in thread main() error
package problem
JAR file problem
class accessibility