Aaron Digulla
Aaron Digulla

Reputation: 328840

Is JavaFX available for every Java VM?

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?

Upvotes: 3

Views: 1625

Answers (3)

jewelsea
jewelsea

Reputation: 159576

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.

Upvotes: 3

Cypher
Cypher

Reputation: 2707

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.

Upvotes: 0

David Cohen
David Cohen

Reputation: 429

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.

Upvotes: 1

Related Questions