@oracle/build-native-image-gradle
BBuild 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.
Install
agr install @oracle/build-native-image-gradle --target claudeWrites 1 file into .claude/skills/, pinned to git-9aec5c91.
- .claude/skills/build-native-image-gradle/SKILL.md
Document
name: build-native-image-gradle description: 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.
Gradle Native Image Build
Prerequisites
- Set
JAVA_HOMEto a GraalVM JDK installation so Gradle Native Build Tools can findnative-image. - Do not require
GRAALVM_HOMEin the normal case. Only mention it if the user already relies on it or their environment needs an explicit override. - Apply the
application,java-library, orjavaplugin along withorg.graalvm.buildtools.native.
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 |
Trustgrade B
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- warnLicenseno SPDX license detected
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-9aec5c91b8802026-07-31