View Single Post
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-11-05, 23:48

So I decided i wanted to tech myself some OOP and i picked up a book on java (head first series).

First thing i try to compile is a very simple "Hello world" type app (code below).
It compiles without error, however, i get an exception thrown at me when i try to execute it.

Source code for class:
Code:
public class MyFirstApp { public static void main (String[] args) { System.out.print("I Rule!"); System.out.print("The World!"); } }
error message displayed upon execution:

Code:
Exception in thread "main" java.lang.NoClassDefFoundError: MyFirstApp/class
i know my java is up to date, but i still can't figure out what is wrong. Any suggestions?


EDIT:
*smacks forhead onto desk*
had i read the book a little more carefully, i would have seen that i need to type "java MyFirstApp" to execute it, not "java MyFirstApp.class"

sorry for the disruption folks
  quote