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


ActiveState Komodo Is Now Open Source Software
12/01/2023

ActiveState has finally let go of its venerable Komodo IDE, handing it over to the open source community which will now take the lead. 



Spin Brings WebAssembly To The Cloud
19/01/2023

Spin is a new open source framework for building and running cloud microservices with WebAssembly which run on the Fermyon Cloud. Fermyon has also released an SDK for . NET.


More News

picobook

 



 

Comments




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

Last Updated ( Tuesday, 15 March 2022 )