
java-add-graalvm-native-image-support
GraalVM Native Image skill for Spring Boot, Micronaut and plain Java: detects the build tool and framework, adds native image support, builds the executable, analyzes errors, and iterates until the native build succeeds and the binary runs correctly. For Quarkus projects it only dispatches to the quarkus-native-and-container skill.
- Installs
- 8.7K
- Last 24h
- —
- Trending rank
- —
- Security
- Warn
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/github/awesome-copilot --skill java-add-graalvm-native-image-support- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads java-add-graalvm-native-image-support automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
GraalVM Native Image Support
Single source of truth for adding GraalVM Native Image to a Java project, whatever the framework. Work iteratively: configure, build, read the error, fix, rebuild, until the native build succeeds and the executable runs correctly.
Detail lives in references/; load only what the project needs:
| Topic | File |
|---|---|
| Maven / Gradle native plugin setup | references/build-tools.md |
| Reachability metadata and tracing agent | references/reachability-metadata.md |
| Common build/runtime errors and fixes | references/troubleshooting.md |
Spring Boot (AOT, -Pnative, nativeCompile, build-image) | references/spring-boot.md |
| Quarkus | quarkus-native-and-container skill (hand off); short pointer in references/quarkus.md |
| Micronaut | references/micronaut.md |
Step 1: Analyze the project
- Build tool:
pom.xml(Maven) orbuild.gradle/build.gradle.kts(Gradle). Prefer the wrapper (./mvnw,./gradlew) when present. - Framework, from dependencies/plugins:
- Spring Boot:
spring-boot-starter-parent,spring-boot-maven-plugin, ororg.springframework.bootGradle plugin - Quarkus:
io.quarkusBOM/plugin orquarkus-*dependencies - Micronaut:
io.micronautparent/plugin ormicronaut-*dependencies - otherwise plain Java
- Spring Boot:
- Existing native configuration: native-build-tools plugin,
META-INF/native-image/, native profile,application.propertiesnative keys. - Toolchain: run
java -versionandnative-image --version. Local native compilation needs a GraalVM JDK (withnative-image) as the JDK used for the build. Container or buildpack builds (Spring Boot buildpacks viabootBuildImage/spring-boot:build-image, Quarkus container builds) compile inside a container and need no local GraalVM, only a container runtime. Check the project's Java level against the installed GraalVM version.
If the framework is Quarkus, stop here and hand off to the quarkus-native-and-container skill. Container builds there need no local GraalVM.
Scope and JVM baseline
- Adding native support does not authorize a JDK, framework, library, build-tool, or wrapper upgrade. Preserve the existing BOM/parent-managed versions and test conventions; ask before changing versions to solve native compatibility.
- Run the project's existing JVM build and tests before editing. Record pre-existing failures rather than weakening checks to hide them. Keep the JVM packaging/run path working alongside native support.
- After any approved dependency or framework change, rerun that JVM baseline before continuing with native builds. Verify the same relevant behavior on both JVM and native paths.
- Ask before creating or changing CI workflows, adding native CI jobs, or changing runner resources. Suggest commands separately if CI changes were not requested.
Step 2: Get a GraalVM toolchain
- Oracle GraalVM (free under the GraalVM Free Terms and Conditions) and GraalVM Community Edition builds provide
native-image. Use a release matching the project's Java version (for example, GraalVM for JDK 21 or newer; Spring Boot 3.x/4.x need a Java 17+ baseline, see the Spring reference). - Install with SDKMAN (
sdk list java, thensdk install java <identifier>using an identifier from that list), a vendor download, or a CI action such asgraalvm/setup-graalvm. Pick the version from the vendor's current download page rather than hard-coding one. - Linux needs a C toolchain and zlib headers (
build-essential,zlib1g-dev); macOS needs Xcode command line tools; Windows needs Visual Studio Build Tools. Check the current GraalVM "Native Image prerequisites" page.
Step 3: Add native support
Per framework:
- Spring Boot: with Maven,
spring-boot-starter-parentonly manages the native plugins' versions and configuration in itsnativeprofile, so declarenative-maven-pluginandspring-boot-maven-pluginin<build><plugins>if missing (no versions needed); with Gradle, applyorg.graalvm.buildtools.nativenext toorg.springframework.boot; a custom parent needs the plugin added by hand. Do not duplicate configuration the parent already provides. See references/spring-boot.md. - Quarkus: hand off to the
quarkus-native-and-containerskill. - Micronaut: built in via the Micronaut build plugins. See references/micronaut.md.
- Plain Java (or any project without a framework plugin): add the GraalVM Native Build Tools plugin. See references/build-tools.md. Resolve the plugin version at run time from Maven Central (
org.graalvm.buildtools:native-maven-plugin) or the Gradle Plugin Portal (org.graalvm.buildtools.native) and pin it in the build file; do not copy a version from memory.
Step 4: Build
| Setup | Command |
|---|---|
| Plain Maven | ./mvnw -Pnative native:compile |
| Plain Gradle | ./gradlew nativeCompile |
| Spring Boot Maven | ./mvnw -Pnative native:compile (or spring-boot:build-image for a container) |
| Spring Boot Gradle | ./gradlew nativeCompile (or bootBuildImage) |
| Micronaut Maven | ./mvnw package -Dpackaging=native-image |
| Micronaut Gradle | ./gradlew nativeCompile |
Native builds are slow and memory hungry (several GB of RAM). Capture the full output to inspect it.
Step 5: Iterate until the build succeeds
- Read the first real error, not the final summary.
- Match it against references/troubleshooting.md.
- Apply the smallest fix, in this order of preference:
- Check whether a compatible library/framework version has built-in native support (see the reachability metadata repository). Propose the upgrade; apply it only with user approval and rerun the JVM baseline. If declined, try metadata or framework hints compatible with the current versions.
- Use the framework's own mechanism (Spring
RuntimeHints, Quarkus@RegisterForReflection, Micronaut@Introspected). - Collect metadata with the tracing agent (see references/reachability-metadata.md).
- Hand-write metadata under
src/main/resources/META-INF/native-image/<groupId>/<artifactId>/. - Adjust initialization (
--initialize-at-build-time/--initialize-at-run-time) only for specific classes.
- Rebuild. Repeat until the build completes with no errors.
Step 6: Verify the executable
A successful build is not enough: many problems only appear at runtime.
- Run the binary and exercise the main paths (HTTP endpoints, DB access, serialization, resource loading, scheduled jobs).
- Run the native tests where the framework supports them (
native:test,nativeTest, Quarkus@QuarkusIntegrationTest). - Compare startup time and memory against the JVM run only if the user asks for it.
- Report the exact commands run, whether the build and the run succeeded, and any remaining warnings.
Pitfalls
- Recommend a native build and native test run in CI with an explicit GraalVM version; add or change CI only with user consent.
- Mockito's default inline mock maker does not work on native image (Mockito 5.0.0 release notes); use the subclass mock maker for native tests.
- Do not leave
--report-unsupported-elements-at-runtimeor verbose flags in production builds unless justified.
References
- GraalVM Native Image documentation
- Native Build Tools
- GraalVM reachability metadata repository
- Spring Boot GraalVM native images
- Quarkus building a native executable
- Micronaut GraalVM guide
Upstream sources (read before upgrading GraalVM or native config)
Fetch the page for the target version; prefer it over this skill when they conflict.
- GraalVM release notes: https://www.graalvm.org/release-notes/
- Reachability metadata format: https://www.graalvm.org/latest/reference-manual/native-image/metadata/
- Build configuration options: https://www.graalvm.org/latest/reference-manual/native-image/overview/BuildConfiguration/
- Metadata repository (check your library versions are covered): https://github.com/oracle/graalvm-reachability-metadata
FAQ
What does the java-add-graalvm-native-image-support skill do?
GraalVM Native Image skill for Spring Boot, Micronaut and plain Java: detects the build tool and framework, adds native image support, builds the executable, analyzes errors, and iterates until the native build succeeds and the binary runs correctly. For Quarkus projects it only dispatches to the quarkus-native-and-container skill.
How do I install java-add-graalvm-native-image-support?
Run npx skills add https://github.com/github/awesome-copilot --skill java-add-graalvm-native-image-support in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/java-add-graalvm-native-image-support/ (personal) or .claude/skills/java-add-graalvm-native-image-support/ (project).
Which AI agents can use java-add-graalvm-native-image-support?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is java-add-graalvm-native-image-support safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed; Runlayer flagged items to review; ZeroLeaks passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains java-add-graalvm-native-image-support?
It is published by github in github/awesome-copilot, and it is an official skill from the maker of the technology it covers. It has 8,717 recorded installs.
More from github/awesome-copilot
git-commit
github/awesome-copilot
Use this skill when the user wants to make a Git commit or split changes into more than one commit. Also use it when the user types "/commit" or asks for a conventional commit. The skill examines the diff, stages the related files, writes a Conventional Commits message, and runs git commit. Do not use it when the user wants only a commit message and no commit. Do not use it to push, open a pull request, rebase, or change the commit history.
excalidraw-diagram-generator
github/awesome-copilot
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
multi-stage-dockerfile
github/awesome-copilot
Create optimized multi-stage Dockerfiles for any language or framework
documentation-writer
github/awesome-copilot
Diátaxis Documentation Expert. An expert technical writer specializing in creating high-quality software documentation, guided by the principles and structure of the Diátaxis technical documentation authoring framework.
prd
github/awesome-copilot
Generate high-quality Product Requirements Documents (PRDs) for software systems and AI-powered features. Includes executive summaries, user stories, technical specifications, and risk analysis.
refactor
github/awesome-copilot
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.