So I just survived the nightmare of getting everything up and running and I have run into my second problem
Im trying to compile my second app and I get a error saying an exception in the tread "main and a long list of where the eroor is and then it says it cannot find the class
PrasannaKumar Sathiyanantham
Ranch Hand
Joined: Nov 12, 2009
Posts: 110
posted
0
please paste the code and the command prompt output so that we may know what is the error
set HelloWorldApp.java in classpath while running the java command.
Kuldip
Aditya Kanitkar
Ranch Hand
Joined: Aug 08, 2009
Posts: 72
posted
0
This error is related with one of the following
1. Name of the java file and Name of the Java Class is diffrent.
2. The same class is included in a package, but the class is not there in
package named folder.
sam johnston
Greenhorn
Joined: Feb 08, 2010
Posts: 14
posted
0
I'm sorry for my absolutenoobishness but how would one go about doing that?
A NoClassDefFoundError almost always means that your classpath is set incorrectly.
The classpath is a list of directories and jar files that Java uses to find *.class files. Normally (by default), Java looks in the current directory for *.class files. When you execute the command java HelloWorldApp, are you in the directory that contains the file HelloWorldApp.class? Did you compile your HelloWorldApp.java source file before you're trying to run it?
Do you have the CLASSPATH environment variable set to anything? If you have, then unset it.
sam johnston wrote:I'm sorry for my absolutenoobishness but how would one go about doing that?
I didnt get you on this.... What do you mean by that?
You could quote a sentense on which you want to comment.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
[Off topic: When did starting sentences with "so" become trendy? There was actually a thing about it on Quirks and Quarks a few months ago, but I was left unsatisfied.]
I have never had to set my classpath, and I've compiled dozens of applications.
I agree with this:
Aditya Kanitkar wrote:This error is related with one of the following
1. Name of the java file and Name of the Java Class is diffrent.
2. The same class is included in a package, but the class is not there in
package named folder.
Sam, post your code, please.
When you do things right, people won't be sure you've done anything at all.
sam johnston
Greenhorn
Joined: Feb 08, 2010
Posts: 14
posted
0
This seems to be an error with javac I am not even able to generate a .class I have been looking at the tutorial on suns website with no luck. Even downloading their pretyped version of the code still yields me the same error I posted above.
sam johnston
Greenhorn
Joined: Feb 08, 2010
Posts: 14
posted
0
I have messed with it some more and here are my results