> -------Suns JDK --------------------------------
> [EMAIL PROTECTED] bin]$ ~/jdk1.5.0_06/bin/javac -version
> javac 1.5.0_06
>
> [EMAIL PROTECTED] bin]$ ~/jdk1.5.0_06/bin/javac Test.java
>
> [EMAIL PROTECTED] 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

Reply via email to