build-native-image-gradle

Automate GraalVM native image builds from Java projects via Gradle tasks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Build GraalVM native images from Java projects by using the Gradle plugin to streamline configuration, improve startup time, and produce standalone executables.

Core Features & Use Cases

  • Automates native image builds via Gradle tasks nativeCompile, nativeRun, and nativeTest.
  • Enables GraalVM native tooling integration directly from build.gradle or build.gradle.kts.
  • Use cases include packaging Java applications as fast, portable binaries for cloud, desktop, or embedded environments.

Quick Start

Run the Gradle task nativeCompile to produce a native image for your Java application.

Frequently Asked Questions about build-native-image-gradle

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

FAQPage Schema
How do I build a GraalVM native image from a Gradle Java project?

To build a GraalVM native image with Gradle, run the nativeCompile task. This automates native-image tooling integration via build.gradle, producing a standalone executable with fast startup and reduced memory footprint.

What Gradle tasks are available for native image builds?

The Gradle plugin provides nativeCompile, nativeRun, and nativeTest tasks for native image builds. These tasks automate configuration in build.gradle to produce standalone executables and run tests against the native binary.

Do I need GraalVM native-image tooling installed to use the Gradle plugin?

Yes, building GraalVM native images requires the native-image tooling and proper Java home configuration. The Gradle plugin relies on these prerequisites to compile Java applications into standalone executables.

Can I use the Gradle native image plugin with Kotlin DSL build files?

Yes, GraalVM native tooling integration supports both build.gradle and build.gradle.kts files. You can configure the nativeCompile task and native-image options directly within Kotlin DSL scripts.

Why does my Gradle native image build fail or produce errors?

Native image build failures often stem from missing prerequisites like Java home misconfiguration or absent native-image tooling. The Skill provides troubleshooting guidance for common build.gradle configuration and build errors.

When should I use GraalVM native images for Java applications?

Use GraalVM native images for Java applications requiring fast startup, reduced memory footprint, and standalone executables. They are ideal for packaging cloud, desktop, or embedded environments via Gradle builds.