You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=== GraalVM Native Image https://www.graalvm.org/docs/reference-manual/aot-compilation/[GraalVM native-image] allows you to ahead-of-time compile Java code to a standalone executable, called a native image. This executable includes the application, the libraries, the JDK and does not run on the Java VM, but includes necessary components like memory management and thread scheduling from a different virtual machine, called “Substrate VM”. Substrate VM is the name for the runtime components (like the deoptimizer, garbage collector, thread scheduling etc.). The resulting program has faster startup time and lower runtime memory overhead compared to a Java VM.
== Packaging Your Application
Subsections below discuss some options you have for packaging your application for distribution.
=== Build Tool Plugins
Both https://www.mojohaus.org/appassembler/[Application Assembler Maven Plugin] and https://docs.gradle.org/current/userguide/application_plugin.html[Gradle Application plugin] create a distribution zip or tar file with launcher scripts. Both require a JRE to be installed on the target machine.
=== Launch4j and JDK 8 JavaPackage
http://launch4j.sourceforge.net/docs.html[launch4j] and JDK 8 https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html[javapackage] can create a native launcher executable. Can bundle a JRE (~200MB) or use a pre-installed one.
=== JLink
Java 9 introduced the JPMS module system and it is now possible to use https://docs.oracle.com/javase/9/tools/jlink.htm#JSWOR-GUID-CECAC52B-CFEE-46CB-8166-F17A8E9280E9[jlink] to create a custom light-weight JRE with only the necessary modules. JLink also generates launcher scripts. (JLink can be https://medium.com/azulsystems/using-jlink-to-build-java-runtimes-for-non-modular-applications-9568c5e70ef4[used] for non-modular apps.)
=== JPackage (Early Access)
https://jdk.java.net/jpackage/[jpackage] (early access build) https://openjdk.java.net/jeps/343[JEP 343: Packaging Tool]. JPackage can take the custom light-weight JRE produced by JLink and create an installer and a native application launcher. The result is not a single executable but a Java "application image" that is a single directory in the filesystem containing the native application launcher, resources and configuration files, and the custom light-weight JRE runtime image (including the application modules) produced by JLink. See also https://www.infoq.com/news/2019/03/jep-343-jpackage/[this InfoQ article]. Gradle users may like these plugins: https://badass-runtime-plugin.beryx.org/releases/latest/[org.beryx Badass Runtime Plugin] and https://badass-jlink-plugin.beryx.org/releases/latest/[org.beryx Badass JLink Plugin].
=== GraalVM Native Image
https://www.graalvm.org/docs/reference-manual/aot-compilation/[GraalVM native-image] allows you to ahead-of-time compile Java code to a standalone executable, called a native image. This executable includes the application, the libraries, the JDK and does not run on the Java VM, but includes necessary components like memory management and thread scheduling from a different virtual machine, called “Substrate VM”. Substrate VM is the name for the runtime components (like the deoptimizer, garbage collector, thread scheduling etc.). The resulting program has faster startup time and lower runtime memory overhead compared to a Java VM.
// * https://en.wikipedia.org/wiki/Service_wrapper[service wrapper]? Wrapper program to run your Java program as a Windows Service or Unix Daemon. Not discussed in more detail in this article.
https://steveperkins.com/using-java-9-modularization-to-ship-zero-dependency-native-apps/
The text was updated successfully, but these errors were encountered: