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: 

  • Almost instant startup time
  • Optimized resource consumption and smaller static footprint
  • Does not require JVM for execution 

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 22.0.0.2 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 22.0.0.2 is based on Liberica JDK 11.0.14.1+1 and Liberica JDK 17.0.2+9 version. The distribution also includes: 

  • LLVM - 12.0.1 (GraalVM CE Native 22.0.0.2)
  • Python - 3.8.5 (GraalVM CE Native 22.0.0.2)
  • Node - v14.18.1
  • Java Script - GraalVM JavaScript (GraalVM CE Native 22.0.0.2)
  • R - 4.0.3 (FastR)
  • TruffleRuby - 22.0.0.2 (Ruby 2.7.4)
  • Native Image - GraalVM Version 22.0.0.2 (Liberica JDK 11.0.14.1+1, LTS and Liberica JDK 17.0.2+9, LTS)
  • Wasm - WebAssembly (GraalVM CE Native 22.0.0.2) 

Full release notes at Liberica Native Image Kit 22.0.0.2 Release Notes.

Available from the  Download Centerr

 

More Information

Liberica Native Image Kit

Create a microservices constellation with Micronaut and Liberica Native Image Kit

Quarkus and Liberica Native Image Kit: it takes two to make a difference

The new Spring is here!

Related Articles

Micronaut 3. 2 Released for More Performant Microservices

GraalVM Under The Covers

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.

Banner


Use Javascriptmas To Hone Your Webdev Skills
08/12/2024

Every day until December 24th MDN, in partnership with Scrimba, is releasing a daily challenge, which as the name suggests requires you to practice your JavaScript skills. Each solution you submi [ ... ]



Advent Of Code 2024 Now Underway
01/12/2024

December 1st is much anticipated among those who like programming puzzles. It is time to start solving small but tricky puzzles on the Advent of Code website with the goal of amassing 50 stars by Chri [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 15 March 2022 )