building-native-image
What it does
This skill guides the AI through building Java apps with GraalVM Native Image, setting build options, and fixing problems. It is for developers who want a Java program that runs as a single native executable.
When to use it
- ✓When you need to turn a Java program into a native executable with GraalVM.
- ✓When a Native Image build or the resulting app fails with reflection, JNI, resource, or proxy errors.
- ✓When you want to change Native Image build options such as the classpath, output name, or optimization level.
Skill link
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/skills/building-native-image/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Help me build my Java app into a native executable with GraalVM Native Image.”
5 new skills a week. 1 minute to read.
How it works
The AI follows steps to compile the Java code, run the native-image tool, and start the result. For errors, it checks a reference guide on reflection, resources, and serialization.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
# Building Native Image
Prerequisites
- Set
JAVA_HOMEto a GraalVM distribution if your Java program uses the Native Image SDK. If you do not know the path, ask the user to provide it.
Build and Run
- Compile your Java file with
javac. - Build the Native Image:
$JAVA_HOME/bin/native-image <app-name> - Run the resulting executable:
./app-name - If Native Image cannot find your class file, set the classpath explicitly with the
-cpoption.
Troubleshooting
Reachability Metadata
If you encounter runtime errors related to reflection, JNI, resources, serialization, or dynamic proxies, consult references/reachability-metadata.md before attempting a fix. Use this reference for:
NoClassDefFoundErrororMissingReflectionRegistrationErrorMissingJNIRegistrationErrorMissingResourceException(missing resource bundle)- Any user question about reflection, JNI, proxies, resources, resource bundles, or serialization in Native Image.
Native Image Options
To configure classpath, optimization level, output name, platform target, monitoring, or other CLI flags, see references/native-image-options.md.
Reference Files
| Topic | File |
|---|---|
| Native Image CLI options | references/native-image-options.md |
| Missing reachability metadata | references/reachability-metadata.md |
FAQ
Do I need GraalVM installed to use this skill?
Yes. The skill expects JAVA_HOME to point to a GraalVM distribution, and the AI will ask you for its path if it does not know it.
What kinds of errors does it help with?
It covers errors such as missing reflection registrations, missing JNI registrations, and missing resource bundles.
Can it help me change the build options?
Yes. It includes a reference of Native Image command-line options for the classpath, output name, platform target, and more.
Details
Original description by the author
Build and troubleshoot GraalVM Native Image applications. Use this skill to build Java applications with GraalVM Native Image, configure CLI options, or resolve build or runtime issues.
repo: oracle/graal
Popularity
- GitHub stars
- 22k
- Ranking position
- #10358
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
build-native-image-gradle
22kHelps your agent build Java apps into fast GraalVM native images with Gradle, and fix common build or runtime problems.
build-native-image-maven
22kHelps your agent build Java apps into GraalVM native images with Maven, configure the pom.xml, run native tests and fix build issues.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.