Skip to content
Back to skills

Building Native Image

ASecurity

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.

  • 21,721 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added June 5, 2026
developmentjavabash

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned June 5, 2026

npx -y skills add oracle/graal --skill building-native-image --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Building Native Image?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Building Native Image
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oracle-building-native-image/badge)](https://www.skillsdirectory.com/skills/oracle-building-native-image)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: building-native-image
description: 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.
---

​# Building Native Image

## Prerequisites
- Set `JAVA_HOME` to 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
1. Compile your Java file with `javac`.
2. Build the Native Image:
	```bash
	$JAVA_HOME/bin/native-image <app-name>
	```
3. Run the resulting executable:
	```bash
	./app-name
	```
4. If Native Image cannot find your class file, set the classpath explicitly with the `-cp` option.
​

## Troubleshooting

### Reachability Metadata
If you encounter runtime errors related to reflection, JNI, resources, serialization, or dynamic proxies, consult [`references/reachability-metadata.md`](references/reachability-metadata.md) before attempting a fix. Use this reference for:
- `NoClassDefFoundError` or `MissingReflectionRegistrationError`
- `MissingJNIRegistrationError`
- `MissingResourceException` (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`](references/native-image-options.md).


## Reference Files
| Topic | File |
|-------|------|
| Native Image CLI options | [references/native-image-options.md](references/native-image-options.md) |
| Missing reachability metadata | [references/reachability-metadata.md](references/reachability-metadata.md) |

Files in this skill

  • SKILL.md1.7 KB
  • references/native-image-options.md4.1 KB
  • references/reachability-metadata.md10 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.