Non classé

How do you port your application to native image?

The performance improvements of GraalVM Native Image (mainly from faster cold start times and reductions in RAM use) come at the cost of JVM compatibility. So, we have to be extra careful when porting over new applications.

This tutorial assumes that you’re already familiar with GraalVM Native Image and have installed it.

To build a working native image, you’ll need to create a few configuration files describing your application’s runtime behavior – dynamically linked libraries, reflection, proxies, etc. Here’s the easiest way to get setup:

  1. Upload your jars to Magicator
  2. Download the resulting configuration files
  3. Download the list of unresolved instructions. Resolve them with the GraalVM Tracing Agent
  4. Compile with GraalVM using:
 native-image -cp <classpath>  -H:Name=<program name> -H:Class=<main class> -H:+ReportExceptionStackTraces <mainclass> --no-fallback -H:EnableURLProtocols=http

That’s it. Enjoy!

Have a question? Just write us and we’ll get back to you ASAP.

Leave a Reply