I've got a problem on an older Mac with OS X 10.5.8 "Leopard".
Loading a specific java class is failing with Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
and I know that this normaly states that the java classes are compiled for a higher JVM than the one currently installed.
However, I compiled the classes for Java 6 using JDK 6 and the Mac got Java 6 installed!
This is what java -version
says on the Mac:
bih37-4:~ bih37$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-9M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
And this is how i compiled the java classes with ant 1.7 on a windows system with JDK 1.6.0_43:
<target name="compile" depends="clean">
<javac srcdir="src" destdir="bin" target="1.6" encoding="utf-8">
<classpath refid="classpath.base" />
</javac>
</target>
AFAIK everything should run very smooth, and so it does on Windows 7 and on OS X Mavericks but NOT on OS X 10.5 "Leopard".
To be sure I don't forget something: This is a screenshot of the Java settings on the "Leopard" system:
Any ideas?