I am new to Java Programming. Recently I created a JavaFX program using the latest JDK 15 (https://www.oracle.com/java/technologies/javase-downloads.html) and the latest JavaFX SDK 15 (https://openjfx.io/index.html). Suppose that I need to deploy the application (.jar) in someone else's computer.
From Java 9 onwards, Oracle no longer provides a JRE-only installation kit, either with the Oracle Java badge or the OpenJDK badge. That's why you can't find Java 15 JRE downloads on the Oracle and OpenJDK download sites.
You / they have three options:
jlink
(or similar) to turn your JAR file into an executable with an embedded (cut down) JRE. You then ship that executable rather than the JAR file.My program contains VM options so that can I embed them within the .jar file?
I don't think you can do that. But it should be a simple matter to write a shell script or batch file which calls (for example) java
with the required options.
If you use jlink
you can embed JVM options in the executable; see How to set VM options for JLink launcher executable.
The jpackage
tool may also be an option, though this is not a production feature until Java 16.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With