In searching for a JRE to run my (javafx-based) desktop application I found JRE version 8 from here https://www.java.com/en/download/manual.jsp . This is the default, and this is where I am redirected when clicking the JRE link on Oracle's website (https://www.oracle.com/downloads/#category-java)
But, the JRE does not support --module-path
obviously because it's too old.
What are my options for running my app on non-developer machines? (note the JRE is 60MB and the JDK is 190MB).
I am afraid to ask why the default JRE download is too old?
My app compiles with openjdk 17.0.9 2023-10-17
Two vendors provide editions of their JDK/JRE products for Java 17, 21, and current 22 bundled with the modern generation of OpenJFX libraries implementing JavaFX: Azul Systems and BellSoft.
Understand that JavaFX has never been a standard part of Java.
And understand that JavaFX is now implemented in the open-source project OpenJFX. That project is under continual active development, co-led by Oracle Corp and the Gluon company.
Years ago, Oracle chose to bundle JavaFX libraries with some of its JDK/JRE products. Then later they stopped bundling.
Oracle is but one of several vendors offering JDK/JRE products. See Java Is Still Free for an explanation of the Java ecosystem.
Some JDK/JRE vendors currently choose to bundle the JavaFX libraries implemented as OpenJFX in some editions of their products. I know of at least two such vendors:
The Java Platform Module System arrived in 2017 in Java 9 and later. The vendors listed above offer JavaFX-bundles for the modularized LTS versions 11, 17, and 21, as well as the current version (now 22).
JavaFX 22 requires JDK/JRE 17 or later.
Alternatively, you can bundle the OpenJFX libraries within your app. And you can bundle a JRE within your app, and optionally slim down the JRE to include only the parts that your app uses. The OpenJDK project offers tooling to assist: jlink and jpackage.
The cutting-edge technology uses GraalVM to produce a native app from your JavaFX project.
You asked:
But, the JRE does not support --module-path obviously because it's too old.
Java 9 and later has the Java Platform Module System (JPMS). Focus on the LTS versions (11, 17, 21) and current (22) as the other versions have reached EOL(End of Life). The latest versions of OpenJFX support Java 17 and later.
What are my options for running my app on non-developer machines?
If you have control over user machines, such as in an enterprise or education environment, consider having the sysadmins install a JRE that comes bundled with the necessary OpenJFX libraries.
In a niche market, perhaps you can require your users to install a JRE bundled with the OpenJFX libraries.
In a broad retail market, you’ll need to bundle both a JVM and the OpenJFX libraries within your app. The app marketplaces such as Apple App Store will accept such a product.
(note the JRE is 60MB and the JDK is 190MB).
You can greatly reduce that size by using the jlink tool with your JPMS modularized project.
I am afraid to ask why the default JRE download is too old?
The “why” is simply that Oracle later decided to stop bundling JavaFX libraries with their own JDK/JRE products.
But you are free to bundle the OpenJFX libraries within your app, at no cost.
And, you have the choice of obtaining more recent versions of Java JDK/JRE bundled with OpenJFX libraries from vendors other than Oracle. You can obtain free-of-cost products as well as products with paid support.
My app compiles with openjdk 17.0.9 2023-10-17
Then you can use OpenJFX 22 while compiling for Java 17.