You did successfully compile the code; you just got some warnings. The "unsafe operation" warnings are benign, in any case. They're produced only by JDK 1.5. If your IDE is using an older JDK, or if it's passing the "-source 1.4" switch to this JDK, then you wouldn't see the warnings. They're nothing to worry about, really. Use
Now, about the runtime errors: when you run a Java class, it's the "*.class" file, not the "*.java" file, that the "java" program uses. Furthermore, you don't tell java the name of the file, but rather the name of the class; in other words, to run from the command line, say