Very New Programmer - NoClassDefFoundError - How Can I Fix My Problem?
I was so intrigued by the Java language that I wanted to learn the language, pretty simple. So, I followed this guys tutorial and it was very nice and up to the point where you have to run the java file I get an error.
This is the link to the tutorial followed:
Code :
http://www.youtube.com/watch?v=5u8rFbpdvds&feature=fvwrel
Here is what is in the oranges.java in the Test folder in the C drive.
Code Java:
class oranges{
public static void main(String args[]){
System.out.println("Hello Youtube");
}
}
This is the error I receive:
http://puu.sh/1tdMa
Please remember that this is the first time I've EVER attempted to try to learn Java and I know there will be humps in the way but that's why I am here! Thanks guys!
Re: Very New Programmer - NoClassDefFoundError - How Can I Fix My Problem?
Have you first tried compiling the code by calling javac oranges.java?
Re: Very New Programmer - NoClassDefFoundError - How Can I Fix My Problem?
Quote:
Originally Posted by
curmudgeon
Have you first tried compiling the code by calling javac oranges.java?
Yes sir I have. I have oranges.class in my Test folder in my C: drive.
Re: Very New Programmer - NoClassDefFoundError - How Can I Fix My Problem?
Try stating the classpath when you run the program, something like:
java -cp . oranges
(note the period between -cp and oranges as it is very important)
Re: Very New Programmer - NoClassDefFoundError - How Can I Fix My Problem?
Quote:
Originally Posted by
curmudgeon
Try stating the classpath when you run the program, something like:
java -cp . oranges
(note the period between -cp and oranges as it is very important)
You're brilliant! Thanks a lot.
Re: Very New Programmer - NoClassDefFoundError - How Can I Fix My Problem?