graalvm
GraalVM provides expert guidance for compiling Java applications into native images with minimal footprint and fast startup. It covers native image configuration, framework integration with Quarkus and Micronaut, build optimization, and deployment strategies for cloud-native environments.
GraalVM helps you build optimized native images for Java applications with frameworks like Quarkus and Micronaut.
AI-generated summary based on this skill's SKILL.md
Install
Mindrally/skills/graalvm
git clone https://github.com/Mindrally/skills
cp -r skills/graalvm ~/.claude/skills/graalvmnpx skillfed install Mindrally/skills/graalvmFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I build native images with GraalVM?
GraalVM compiles Java applications into native images using the Native Image tool. Start by installing GraalVM and the native-image component, then use `native-image` command-line tool or Maven/Gradle plugins to compile your application. GraalVM analyzes your code at build time to eliminate unused classes and optimize the resulting binary for fast startup and low memory consumption.
What is GraalVM reflection configuration for native builds?
GraalVM reflection configuration enables native images to use Java reflection, which isn't available at build time due to the closed-world assumption. GraalVM provides a tracing agent that discovers reflection usage during test runs, generating configuration files (reflect-config.json) that tell the native compiler which classes, methods, and fields need reflection support in the compiled image.
How do I integrate GraalVM with Quarkus, Micronaut, or Spring Native?
GraalVM integrates seamlessly with these frameworks through dedicated extensions and plugins. Quarkus and Micronaut are optimized for native compilation out-of-the-box with built-in GraalVM support. Spring Native provides similar capabilities for Spring Boot applications. Each framework handles reflection, resource, and serialization configuration automatically, reducing manual setup required for native image builds.
How can GraalVM reduce Java microservices startup time?
GraalVM native images eliminate JVM startup overhead by pre-compiling Java bytecode to machine code at build time. This dramatically reduces startup time from seconds to milliseconds and cuts memory footprint by 5-10x compared to traditional JVM deployments. These improvements make GraalVM ideal for containerized microservices, serverless functions, and cloud-native applications requiring rapid scaling.
What resources and serialization must I configure for GraalVM?
GraalVM requires explicit configuration for resources and serialization because the native compiler can't discover them dynamically. Use resource-config.json to declare classpath resources, and serialization-config.json for serializable classes. The tracing agent automatically generates these files during application testing, or you can manually define them based on your application's needs.
How do I troubleshoot GraalVM native image build failures?
GraalVM build failures typically stem from missing reflection, resource, or serialization configuration. Enable verbose output with `--verbose` flag, use the tracing agent to discover missing configurations, and check build reports for unused code elimination issues. Common solutions include adding configuration files, adjusting initialization settings, or using `--initialize-at-run-time` for problematic classes.
SKILL.md
rendered from the published skill — quoted content, verbatim
GraalVM
You are an expert in Java programming, GraalVM native builds, Quarkus framework, Micronaut framework, Jakarta EE, MicroProfile, Vert.x for event-driven applications, Maven, JUnit, and related Java technologies.
Code Style and Structure
- Write clean, efficient, and well-documented Java code optimized for GraalVM native compilation
- Follow framework-specific conventions (Quarkus, Micronaut, Spring Native) while ensuring GraalVM compatibility
- Use descriptive method and variable names following camelCase convention
- Structure your application with consistent organization (resources, services, repositories, entities, configuration)
GraalVM Native Image Specifics
- Configure native image builds for optimal performance and minimal footprint
- Understand and configure reflection, resources, and serialization for native compilation
- Use build-time initialization when possible to reduce startup time
- Implement proper substitutions for incompatible code paths
Naming Conventions
- Use
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
graalvm/SKILL.md