Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Exception in Thread Main

  Asked By: Francisca    Date: Sep 25    Category: Java    Views: 804
  

I have encountered a strange problem
While exucting main class in java ....code as follows
Code:
============
Exception in thread "main" java.lang.NoClassDefFoundError: DeitelDrawing.

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Willard Washington     Answered On: Sep 25

The classfile is not there so u just keep teh file in
teh calsspath and run it

 
Answer #2    Answered By: Emily Brown     Answered On: Sep 25

please use the following command

java -cp . DeitelDrawing

note space before and after the dot

from the command line

 
Answer #3    Answered By: Jarrod Williams     Answered On: Sep 25

You got an error message java.lang.NoClassDefFoundError, this should happen
when you are trying to compile java  program with wrong name. for ex. (1)If
your program's name is DeitelDrawing you may have entered javac
deiteldrawing or javac Deiteldrawing, as you already know JAVA is case
sensitive. So please check you have entered class  name as you specify while
creating it. (2)Or you may have in other folder than your class is in? (3)
Or check your classpath.



I hope this is helps you?

 
Answer #4    Answered By: Evelyn Hughes     Answered On: Sep 25

Include rt.jar in your CLASSPATH.

 
Answer #5    Answered By: Douglas Sullivan     Answered On: Sep 25

try setting classpath properly .. just add u r java class  to the classpath

 
Answer #6    Answered By: Cambria Lopez     Answered On: Sep 25

or if you don't want to set every class  you ever write to the classpath,
you can just include . in your classpath. It tells your OS to include
everything in the current directory in the classpath.

 
Didn't find what you were looking for? Find more on Exception in Thread Main Or get search suggestion and latest updates.




Tagged: