Is JavaFX available for every Java VM? - javafx-8

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?

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:
OpenJFX wiki site for open source JavaFX information.
What's the location of the JavaFX runtime JAR file, jfxrt.jar, on Linux?
JavaFXPorts: JavaFX to mobile and embedded hardware, including iPhone, iPad, Android devices, and the Raspberry Pi.
Java FX 2 on IBM jdk?
Certified configurations for JavaFX when running with Oracle Java 8 (Windows, OS X, Linux).
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.
Oracle JavaFX and OpenJFX distributions ship with tools for bundling JavaFX (and an appropriate Java runtime) with your application.
Gluon provides tools for packaging JavaFX applications for iOS and Android.
The JavaFX maven plugin supports bundling via a Maven based toolchain.
The JavaFX gradle plugin supports bundling via a Gradle based toolchain.
In terms of licensing for such distributions, I encourage you to do your own research.
Oracle Binary Code License (if you are bundling Oracle JRE).
OpenJDK Legal Documents (if you are basing the bundled components off of OpenJDK).

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.

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.

Related

Can one use binary packages both in Windows and Linux?

I'm trying to install JDK & Java IDE, I have dual boot (Windows 10 + Ubuntu 18.04), can I make use of the same binary packages in both of my systems?
It depends what the "binary package" consists of.
If it consists of just .class files and other machine independent resources, then yes the same binary can be used on multiple operating systems and even different hardware architectures.
If it also includes native libraries, and the like, then those libraries will be operating system and hardware architecture specific.
If your application "package" is a self-contained JAR file, then it is possible to include native libraries compiled for multiple platforms in the JAR; see How to bundle a native library and a JNI library inside a JAR?
If the package is actually installable package as understood by the host system's package manager (e.g. a Linux RPM, DEB) or a native installer executable, then these are also platform specific.
It also depends on how you handle platform specific things in the application; e.g. running different external commands on different platforms, talking to the Windows Registry, LDAP vs Active Directory, different file system properties and behaviors, etc.
No you can't easily have a single package. I don't know about NetBeans but Eclipse and Java are specific to the operating system because they use many APIs which are different in each OS.

Improvement: decoupled jre version for installer and application possible?

For now it seems to be impossible the decouple the jre for the main application from the jre used by the installer/updater itself. But sometimes there is a reason to use two different jre/jdk. Maybe the application needs java 8 and the installer is built with java 7 or older. Or maybe there are two applications to install which use two different java versions. Another idea is to create some kind of a meta installer that decide during runtime whether to install 32bit or 64bit java depend on the underlying platform architecture? The installer itself then has to use a 32bit version. So what about to decouple it and configure the jre for the application launchers itself independend from the java version of the installer/updater?
Starting with version 6.1.2 the launcher wizard will have an option to configured the JRE search sequence differently from the installer.
The setting will be available under the "Java invocation->Override Java version" step.

Are Eclipse Plugins Platform-Independent?

I want to distribute an eclipse platform with pre-installed plugins to different users with different operation systems.
On the side http://www.eclipse.org/downloads/ I have to choose the target platform for eclipse, so I downloaded it for Linux 32 and 64 bit and for windows 32 and 64 bit.
I want to distribute an eclipse with some pre-installed and also self written plugins to other people. Can I simply install the plugins in one eclipse installation and then copy the files from the /plugins folder to every /plugins folder of the other eclipse versions for linux and windows or are the plugins (also the pre-existing default plugins) in the /plugin folder also platform dependend and must be installed seperatly on the target platform?
Some are, some aren't. Eclipse supports the inclusion of native code in OSGi bundles, and then unpacks it and accesses it via JNI. The native code can be in separate 'fragments', and Eclipse won't necessarily download all the fragments for other architectures.
Well, here's the way I see it: Eclipse is written in Java, which is platform-independent. Eclipse's plugins are, therefor, written in Java, and must be platform-independent. Also, I've yet to encounter a plugin that wasn't platform-independent. So yes, to the best of my knowledge.

Is programming mobile devices using eclipse dead?

I cut my teeth so to speak with eclipse.
Learning Java and even programming mobile devices using Eclipse was a rewarding experince. My last and not so favorable encounter using this platform was Pulsar. But all references to it has disappeared in the new version of Eclipse called indigo. I just like to know if anyone still recommends eclipse when programming mobile device whether J2ME or any other device?
You can continue using Eclipse for developing mobile applications with Indigo release as well. Eclipse Pulsar was a packaging of several Eclipse projects for a providing an all in one download. Pulsar package is discontinued on the indigo release because it lacked the volunteers to support it. However all the projects that were part of the Pulsar are available on indigo release with their new versions.
For JavaME development you can install the eclipse MTJ (mobile tools of Java) using the eclipse update manager.
While Java ME is waning in popularity, Eclipse is now the platform of choice for developing for Android devices (see ADT). I believe Blackberry also has Eclipse-based tooling. What's left is iOS and Windows Phone. For iOS, I have heard some people using Eclipse CDT for development, but it's not a first-class experience due to lack of support from Apple. For Windows Phone, it's Dev Studio all the way.

Difference between eclipse pulsar, mtj, me

what is difference between eclipse pulsar, eclipse mtj, and eclipse me ?
Eclipse ME is an external project started in 2003. As its page says:
EclipseME has graduated to become the new Eclipse Mobile Tools for Java (MTJ) project.
The MTJ project provides all of the functionality from EclipseME 1.7.9 plus many new features and lots of bug fixes. The EclipseME project will remain open indefinitely**, but there will be no new releases of EclipseME**.
Eclipse MTJ is part of the larger DSDP (Device Software Development Platform) set of projects, which addresses a broad range of needs in the device software development space using the Eclipse platform.
MTJ is a project which "will develop frameworks that can be extended by tool vendors and tools that can be used by third-party developers."
Eclipse Pulsar takes advantage of the MTJ framework and provides a "tools integration platform" (as opposed to "an Eclipse with a plugin for mobile development".
It is a package (an Eclipse distribution).
As Chris Aniszczyk says in his blog post:
The other new package is Pulsar which was built specifically for the Mobile Java community.
Pulsar is essentially a mashup of the Eclipse SDK and the Eclipse MTJ projects with the ability of downloading more tools from different handset manufacturers.
You can compare the Pulsar package with other Eclipse packages here.
So:
External Plugin (ME) => official Eclipse project (MTJ) => Full Eclipse distribution (package, with Pulsar)