Build native image gradle

From oracle/graal · View interactive version

Build native image gradle is an AI agent skill from the GitHub repository oracle/graal. Build GraalVM native images using Gradle Native Build Tools. Use this skill to build Java applications with Gradle, configure native-image build.gradle settings, or resolve build or runtime issues.

How to use this skill

Skill file

Gradle Native Image Build

Prerequisites

Plugin Setup

Groovy DSL:

plugins {
    id 'application'
    id 'org.graalvm.buildtools.native' version '0.11.1'
}

Kotlin DSL:

plugins {
    application
    id("org.graalvm.buildtools.native") version "0.11.1"
}

Build and Run

./gradlew nativeCompile   # Build to build/native/nativeCompile/
./gradlew nativeRun       # Build and run the native executable
./gradlew nativeTest      # Build and run JUnit tests as a native image

Build or Runtime Failures

If the build fails with class initialization, linking errors, memory issues, or the binary behaves incorrectly at runtime, see references/native-image-build-gradle-options.md.

Native Testing

If nativeTest fails or you need to configure native JUnit tests or custom test suites, see references/testing.md.

Missing Reachability Metadata

If a build or runtime error reports missing reflection, resource, serialization, or JNI registrations, see references/reachability-metadata.md.

Reference Files

| Topic | File |

|-------|------|

| DSL options and build arguments | references/native-image-build-gradle-options.md |

| Missing reachability metadata | references/reachability-metadata.md |

| Native testing | references/testing.md |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.