I decided to try out the Java tutorials at the Sun Microsystems Website, But I ran into some problems. See if you can help me out.
I've already installed the latest JDK, 6b2.
I followed the instructions here : http://java.sun.com/docs/books/tutor...java/unix.html , and copied the following code and saved it as HelloWorldApp.java
Code:
It compiles fine, but when I try to run it, I get this mess :
Code:
Can anyone tell me what I'm doing wrong? Is it the code which is bad (I doubt) or have I installed the wrong binaries? Or is it something else?
I've already installed the latest JDK, 6b2.
I followed the instructions here : http://java.sun.com/docs/books/tutor...java/unix.html , and copied the following code and saved it as HelloWorldApp.java
Code:
| Quote: |
| /**
* The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. } } |
It compiles fine, but when I try to run it, I get this mess :
Code:
| Quote: |
| sykora@nexus projects/> javac HelloWorldApp.java
sykora@nexus projects/> java HelloWorldApp Exception in thread "main" java.lang.ClassFormatError: HelloWorldApp (unrecognized class file version) at java.lang.VMClassLoader.defineClass (libgcj.so.7) at java.lang.ClassLoader.defineClass (libgcj.so.7) at java.security.SecureClassLoader.defineClass (libgcj.so.7) at java.net.URLClassLoader.findClass (libgcj.so.7) at java.lang.ClassLoader.loadClass (libgcj.so.7) at java.lang.ClassLoader.loadClass (libgcj.so.7) at java.lang.Class.forName (libgcj.so.7) at gnu.java.lang.MainThread.run (libgcj.so.7) sykora@nexus projects/> |
Can anyone tell me what I'm doing wrong? Is it the code which is bad (I doubt) or have I installed the wrong binaries? Or is it something else?
