I think I might be able to figure out which modules are needed using a command like jlink, but I haven’t figured that out yet.
For instance, I don’t use any scripting or XML, so I shouldn’t need java.scripting or java.xml. I don’t think I really need all of those modules, so my next task is to try to figure out which modules I need in that command. In my case I add all of those Java modules because my application is a JavaFX application. I’m creating a native Mac/MacOS image, so I add a few Mac-specific options at the end of that command.I installed JDK 14 in a directory named /Users/al/bin/jdk-14.0.1.jdk.The main class for my application - the class inside that jar file - is named.My jar file is named CliffsNotesEditor-0.1.jar.I put my input jar file and icon in a subdirectory named input.add-modules java.base,ntrols,javafx.web,aphics,dia,java.datatransfer,sktop,java.scripting,java.xml,jdk.jsobject,jdk.unsupported,javafx.fxml,java.naming,java.sql,jdk.charsets \ module-path /Users/al/bin/jdk-14.0.1.jdk/Contents/Home/jmods \ Given that background, here’s the JDK 14 jpackage command I just used to bundle my Scala/Java application into a native MacOS application:
#TO USE JAVA COMMAND LINE TOOL MAC INSTALL#
My default JDK 14 jmods are installed in this directory on my MacOS important part of this process is knowing that you have to install the JavaFX jmods into this folder as well. Prerequisite: Installing the JavaFX jmods You’ve installed the JavaFX jmods from this web page.Very importantly, you’ve installed JDK/SE 14 or newer.You want to write your output files to a directory named output.Your input files are in a directory named input.You want to create an application image (i.e., something that looks like a native application on MacOS, Windows, and Linux).You’ve bundled your complete application into one jar file.If you want to use Java jpackage to bundle your Java/ Scala/JVM application into something that works like a native application, here’s a quick example. Contact me at (al) at valleyprogramming (dot) com for details. Want to work together? Your business can now hire me (Alvin Alexander) for small Scala and Flutter side projects.