Bundle JavaFX app with openjdk 11 + runtime

前端 未结 5 1485
生来不讨喜
生来不讨喜 2020-12-16 01:52

I\'ve created a small HelloWorld Java app that relies on OpenJDK 11 and JavaFX. The app is packaged in a jar file which can only be run if I have installed Java 11 and JavaF

5条回答
  •  抹茶落季
    2020-12-16 02:35

    Modular Java, jlink, & jpackage

    Follow these tutorials found at the new home for JavaFX after having been spun out of Oracle to Gluon.

    You will need to write code using modular Java. Add JavaFX 11 as a dependency to your project. And use the new linking/packaging tools to bundle a subset of the JDK within your app.

    Learn about:

    • Java Platform Module System
    • jlink (JEP 282)
    • jpackage (JEP 343)

    No more JRE

    Oracle no longer intends for end-users to be installing a JRE or a JDK. Java Applets in a browser and Java Web Start app delivery are both being phased out, leaving the end-user with no need for a JRE. Java-based apps are expected to bundle their own Java implementation. The only folks consciously installing a JDK will be developers & server-side sysadmins.

    Important:

    • Understand clearly the nature of the OpenJDK project, as explained in Wikipedia.
    • Know that Oracle has committed to feature-parity between its own branded Oracle JDK and the OpenJDK project. This commitment includes donations of previously-commercial features such as Flight Recorder and Mission Control.
    • OpenJFX, the open-source development of JavaFX, is a part of the OpenJDK project. OpenJFX may or may not be included in a build of OpenJDK. The Java specifications do not require JavaFX functionality.
    • Read this white paper by Oracle of 2018-03, Java Client Roadmap Update
    • Read the white paper Java Is Still Free, authored by key members of the Java community.

    Here is a flowchart diagram that may help you finding and deciding amongst the various vendors providing a Java 11 implementation.


提交回复
热议问题