harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karan malhi <karan.ma...@gmail.com>
Subject error when using sun compiler
Date Tue, 14 Feb 2006 19:57:12 GMT
Hi,

Tried to compile and run a simple hello world program. When I use the 
eclipse programmer, it works fine, but when I use the sun's jdk 
compiler, I get an error . I am still trying to get a feel of this 
project, so probably this was not supposed to work. Could you please 
help me understand why am I getting this error?

---------Eclipse Compiler -----------------------
[karan@j2ee bin]$ pwd
/home/karan/projects/Harmony/deploy/jre/bin

[karan@j2ee bin]$ javac -version
Eclipse Java Compiler v_579_R31x, 3.1.1 release, Copyright IBM Corp 
2000, 2005. All rights reserved.

[karan@j2ee bin]$ javac Test.java
[karan@j2ee bin]$ ./java Test
Hello World

-------Suns JDK --------------------------------
[karan@j2ee bin]$ ~/jdk1.5.0_06/bin/javac -version
javac 1.5.0_06

[karan@j2ee bin]$ ~/jdk1.5.0_06/bin/javac Test.java

[karan@j2ee bin]$ ./java Test
Exception in thread "main" java.lang.UnsupportedClassVersionError: 
(Test) bad major version at offset=6
        at java.lang.ClassLoader.defineClassImpl(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:271)
        at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:64)
        at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1087)
        at java.net.URLClassLoader$4.run(URLClassLoader.java:598)
        at 
java.security.AccessController.doPrivileged(AccessController.java:206)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:595)
        at 
com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.java:25)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
        at 
com.ibm.oti.vm.URLSystemClassLoader.loadClass(URLSystemClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587)

-- 
Karan Singh


Mime
View raw message