The Artima Developer Community
Sponsored Link

Java Buzz Forum
JavaFX FAQ 1: Why The UnsupportedClassVersionError

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
JavaFX FAQ 1: Why The UnsupportedClassVersionError Posted: May 7, 2008 1:30 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: JavaFX FAQ 1: Why The UnsupportedClassVersionError
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

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).

Q: I downloaded the JavaFX Script compiler from http://openjfx.java.sun.com/ (which seems to be down at the moment).
So I have a openjfx-compiler directory with dist/bin/javafxc and dist/bin/javafx inside it.
I'm trying code sample 1 from http://java.sun.com/developer/technicalArticles/scripting/javafx/ria_1/.
It compiles with javafxc, but when I run it with javafx I get the following.

"JavaFX

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.

Tom Ball (on openjfx-compiler mailing list):
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)
...

Read: JavaFX FAQ 1: Why The UnsupportedClassVersionError

Topic: Apple Releases Java 6 Support for Intel Macs Previous Topic   Next Topic Topic: Java 6 on the Mac

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use