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:
- Upload your jars to Magicator
- Download the resulting configuration files
- Download the list of unresolved instructions. Resolve them with the GraalVM Tracing Agent
- 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.