Repository navigation
Native Image Guide
Bernardusz edited this page Jun 9, 2026
·
1 revision
Levtus is highly compatible with GraalVM Native Image, allowing you to compile your Java application into a standalone, lightning-fast binary with near-instant startup.
- JDK 25+ (GraalVM or standard OpenJDK)
-
GraalVM Native Build Tools (e.g.,
native-imageutility)
First, package your application into a single JAR including the Levtus dependency.
Run the following command in your terminal:
native-image -jar my-app.jarLevtus uses Files.probeContentType() to serve static files. On some platforms (like Linux), this may rely on system libraries or property files. Ensure your build environment includes these if needed.
Levtus is designed to be reflection-free. However, if you use a JSON library like Gson or Jackson in your handlers, you must provide a reflect-config.json to GraalVM so it knows which classes to keep.
- Startup: < 20ms
- Memory: Reduced footprint (~20-40MB for simple apps)
- Deployment: Single binary, no JVM installation required on the target machine.