|Making GraalVM-Based Executables Easy|
|Written by Nikos Vaggalis|
|Tuesday, 15 March 2022|
Liberica Native Image Kit is a utility for making native images for the JVM, letting you compile applications to executables using the GraalVM native-image compiler.
As a refresher on what a native image is
Native image is the executable binary file that contains your application, all its dependencies, and runtime components, allowing you to run your JVM based program on any supported configuration without the need for installing runtime or any setup. Native image is the easiest way to distribute your program and start it up faster.
Native images have several advantages over JVM interpreted applications:
But why go for GraalVM over packaging your app with say Launch4J or javapackager? The latter solutions just package your source and dependencies together with the targeted JRE in a dummy executable. When run it just goes through the same JIT compilation procedure, but now just with the embedded JRE. GraalVM on the other hand makes real native executables, no bundled or installation wide JRE necessary.
On the other hand why just not use the GraalVM toolkit directly?As with Spring Native, NIK in essence is a layer over GraalVM which makes interfacing with it much easier by taking care of the necessary configuration out of the box.
Liberica NIK contains the open source builds of Liberica JDK (the two latest Java LTS versions, Java 11 and Java 17, are supported) and a suitable GraalVM Native Image, being fully aligned with GraalVM’s release cadence. NIK is compatible with Linux distributions including Alpine, Windows, and macOS. And it works with containerized applications too.
There's also Liberica NIK Core, a version of Liberica NIK that is restricted to Java-only support. It is perfect for pure Java development, particularly when paired with Spring Native.
Since NIK goes the AOT way, which I've covered in Micronaut 3. 2 Released for More Performant Microservices, it can make executables for Microservices frameworks that are AOT-based, that is Quarkus, Micronaut and Spring Native too.
Talking about Spring Native, BellSoft has announced a support agreement with VMware, that enables a fully supported end-to-end native solution for Spring Boot. Integrating NIK into it, developers will be able to produce Spring Boot native applications seamlessly.
The latest version 126.96.36.199 of NIK contains several enhancements and bug fixes with the most important update being adding support for OpenJFX for MacOS, so that you can develop rich JavaFX apps on Mac.
NIK 188.8.131.52 is based on Liberica JDK 184.108.40.206+1 and Liberica JDK 17.0.2+9 version. The distribution also includes:
Full release notes at Liberica Native Image Kit 220.127.116.11 Release Notes.
Available from the Download Centerr
Create a microservices constellation with Micronaut and Liberica Native Image Kit
Quarkus and Liberica Native Image Kit: it takes two to make a difference
Micronaut 3. 2 Released for More Performant Microservices
Quarkus 2.7.1 Released - Why Quarkus?
Compile Spring Applications To Native Images With Spring Native
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
or email your comment to: email@example.com
|Last Updated ( Tuesday, 15 March 2022 )|