harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Petrenko <alexey.a.petre...@gmail.com>
Subject Re: error when using sun compiler
Date Tue, 14 Feb 2006 20:18:24 GMT
> -------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
It easy :)
You've compiled a class with 1.5 compiler and then run it on 1.4 VM.
You can fix this issue by two ways:
1. Complile the class with -target 1.4 javac option
(~/jdk1.5.0_06/bin/javac -target 1.4 Test.java) and run as ./java Test
2. Compile without target option as you did it before and run on 1.5
VM (~/jdk1.5.0_06/bin/java Test)

This should help.

--
Alexey A. Petrenko
Intel Middleware Products Division
Mime
View raw message