building-native-image

Build GraalVM Native Image executables from Java sources with CLI options.

21.7k|1.8k|Updated Jan 14, 2016
One-click install
npx skills add https://github.com/oracle/graal --skill building-native-image
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-native-image
Source: https://github.com/oracle/graal/tree/main/substratevm/skills/building-native-image
Command: npx skills add https://github.com/oracle/graal --skill building-native-image

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Build GraalVM Native Image executables from Java sources and troubleshoot common build-time and runtime issues to accelerate deployment and startup performance.

Core Features & Use Cases

  • Build Native Image executables from Java sources and configure required CLI options.
  • Troubleshoot reachability metadata, reflection, JNI, and resource-related issues using guided references.
  • Validate and optimize native binaries for startup time, memory footprint, and platform compatibility with practical examples.

Quick Start

Run the native-image tool to compile a Java application into a native executable and verify the result.

Frequently Asked Questions about building-native-image

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a GraalVM Native Image executable from Java sources?

To build a GraalVM Native Image executable, run the native-image CLI tool to compile your Java sources, configuring classpath, initialization strategies, and resource handling to produce an optimized native binary.

Why does my GraalVM Native Image build fail with reflection or resource errors?

Native Image build failures with reflection or resources often occur due to missing reachability metadata. You must configure and validate metadata for JNI, reflection, and resource bundles to resolve these runtime issues.

What is reachability metadata and when do I need it for native-image?

Reachability metadata provides configuration for reflection, JNI, and resource bundles that GraalVM Native Image cannot automatically detect. You need it when your Java application uses dynamic features to ensure robust native binary execution.

Can I configure classpath and initialization strategies for native-image builds?

Yes, you can configure classpath and initialization strategies for native-image builds. The process supports CLI options for classpath setup, initialization control, and resource bundles to produce optimized native binaries.

Does building a GraalVM Native Image require specific CLI tools?

Building a GraalVM Native Image requires the Native Image CLI tools and an existing Java project. These tools compile Java sources into native executables, validating startup time and memory footprint for platform compatibility.