CtrlK
BlogDocsLog inGet started
Tessl Logo

building-native-image

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.

79

Quality

73%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Optimize this skill with Tessl

npx tessl skill review --optimize ./substratevm/skills/building-native-image/SKILL.md
SKILL.md
Quality
Evals
Security

​# 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:
    $JAVA_HOME/bin/native-image <app-name>
  3. Run the resulting executable:
    ./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 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.

Reference Files

TopicFile
Native Image CLI optionsreferences/native-image-options.md
Missing reachability metadatareferences/reachability-metadata.md
Repository
oracle/graal
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.