3

I followed the "JavaFX is going to replace Swing" advice mentioned in several places (SO, Wikipedia, Oracle) but that seems to be a white lie. When I run a JavaFX app with IBMs V9 (build 2.8, JRE 1.8.0), I get:

java.lang.ClassNotFoundException: javafx.application.Application

I couldn't find any resource which explains whether JavaFX is a cross-VM technology or whether this is just another vendor-lock-in "feature".

Where is JavaFX available? If it's not available in some VM, can I install it or bundle it with my application?

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820

3 Answers3

3

JavaFX is not available for every Java VM. For instance, Oracle Solaris Java distributions do not include JavaFX support.

JavaFX is available for many Java VMs. There are JavaFX runtimes available for (at least) the following platforms:

  • OS X, Windows, Linux, iOS, Android and various embedded architectures.

JavaFX download and source locations:

  • Binaries for some JavaFX runtimes (such as OS X, Windows and Linux) are provided by Oracle based upon Oracle JDK sources.
  • Binaries for some other runtimes (Android, iOS and embedded architectures) are provided by Gluon based upon Open JDK sources.
  • Binaries for Debian based Linux systems are in the Debian Package Tracker, based upon OpenJDK sources.
  • Open source code is available to build JavaFX for use with other platforms and Java VMs as part of the OpenJDK project.

For further information, see related questions and resources:

JavaFXPorts enables execution of JavaFX on the Android runtime natively and, currently via RoboVM, on the iOS runtime, for more info see: JavaFXPorts, how it works.

can I install it or bundle it with my application?

Yes.

In terms of licensing for such distributions, I encourage you to do your own research.

Community
  • 1
  • 1
jewelsea
  • 150,031
  • 14
  • 366
  • 406
1

It became integrated partially in Java 7 and more tightly in Java 8 so it should be standard in newer VM's and is slowly opening up. However, I wouldn't consider migrating from Swing to FX as a move up as much as a lateral move as explained here.

David Cohen
  • 429
  • 2
  • 4
  • 1
    Thanks for the link. Seems like JavaFX is already mostly dead. – Aaron Digulla Mar 29 '16 at 15:11
  • 1
    That codenameone link was a bit controversial, there were [alternate views posted on the JavaFX developer mailing list](http://mail.openjdk.java.net/pipermail/openjfx-dev/2015-December/018302.html). – jewelsea Apr 13 '16 at 20:14
  • That's not a contrary viewpoint. The only "controversial" thing about the article is it's title, the rest is pretty factual. The people in the link complain that he raised this point which cements their accuracy further. It's pretty obvious to anyone who looks at JavaFX that Oracle isn't "into it", the article highlights that and contrasts that with Google's approach to throw away projects such as these (e.g. GWT). – David Cohen Apr 15 '16 at 02:54
  • 1
    You mentioned gluon & RoboVM in your post, RoboVM is dead and closed source. Gluon is also closed source and now must rely on OpenJDK which is an interpreter. With the experience we all had with robo closing source and dying I have zero expectations for robo. FX has zero backing from Oracle which effectively stopped shipping things like scene builder (don't get me started on javafxpackager issues)... The FX team at Oracle is much smaller and most of the PR goes to MAF & JET. I don't see room for disagreement with verifiable facts? What do you specifically disagree with? – David Cohen Apr 21 '16 at 07:03
0

IBM provides their own version of Java, and as far as I have ever seen, they do not seem to provide JavaFX in their runtimes for whatever reason. I have only seen JavaFX provided by the canonical Oracle releases.

Cypher
  • 2,608
  • 5
  • 27
  • 41