I was asked a JavaFX Script question yesterday that I think other people may encounter, especially the Mac OS X folks who are trapped in a non-"64-bit-Intel-Leopard" (Core Duo, P5, P4, etc.) machine (who are therefore still without a Java 6 JDK).
Note that I'm using Java 1.5.
Any idea why this doesn't work?
I seem to remember the same problem being asked on the mailing list a while back. So I went to the mailing list archive to find the answer. Since it took me quite a bit time to find the answer, I thought I'd post the link here.
You need to compile with "-target 1.5" on the Mac, at least until Apple
ships Java 6. The compiler generates Java 6 versioned class files by
default, since we are extending the latest version of javac.
Tom
Patrick Wright wrote:
> Hi
>
> I have sync'd with the trunk, built the compiler, and was able to
> compile Jim Weaver's simple test program at
> http://learnjavafx.typepad.com/weblog/2007/11/developing-your.html.
> Trying to run it I get the following:
>
>> javafx CompiledHelloJavaFX
> Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad
> version number in .class file
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
...