I want to write my first JavaFX 8 application (doing my first experiments with e(fx)clipse, etc.) and have a few concerns about platform independence.
JavaFX 8 is a part of the Oracle JRE, which is the most used JRE on Windows. Therefore, I do not really bother here, since JavaFX will be installed on nearly every Windows machine running Java 8.
But on Ubuntu and other *nix, OpenJDK is often used as Java distribution. Since openjfx
is separated from open-jdk-8-*
, many will not have JavaFX installed by default.
I thought of:
- Writing an install script that calls
sudo apt-get install openjfx
(which I would like to avoid, since I would like the executable .jar to be runable on its own, without script) - Shipping a JavaFX distribution (i.e., its .jars) with my applications (but I read that this should not be done)
Both ideas do not seem very promising...
Since I hope that there are some JavaFX pros out there, i hope that someone can help me with "What are the best possibilities to ensure that my JavaFX application will run fine, both on Windows and Ubuntu?" What are state-of-the-art techniques on how to tackle this problem?