examples.md

April 17, 2026 ยท View on GitHub

GraalVM + Bazel Examples

This codebase embeds some examples which are used for integration testing. You can find these at:

example/integration_tests

The following table explains each example. These can be used as starters for various Bazel versions with the latest copy of GraalVM CE.

Available examples

All examples are continuously tested in CI.

PathBazel version(s)Rule typeOS supportNotes
bzlmodBazel 5+ with BzlmodModernLinux, macOS, WindowsExample Native Image build via Bzlmod
workspaceBazel 5+ with WORKSPACEModernLinux, macOS, WindowsExample Native Image build via Workspace
bazel5Bazel 5LegacyLinux, macOSBazel 5 example project
bazel6Bazel 6ModernLinux, macOS, WindowsBazel 6 example project
graalvm-ce-17Bazel 7ModernLinux, macOS, WindowsBazel 7 with GraalVM CE 17
graalvm-ce-20Bazel 7ModernLinux, macOS, WindowsBazel 7 with GraalVM CE 20
graalvm-oracle-17Bazel 7ModernLinux, macOS, WindowsBazel 7 with Oracle GraalVM 17
graalvm-oracle-20Bazel 7ModernLinux, macOS, WindowsBazel 7 with Oracle GraalVM 20
components-ceBazel 7N/ALinux, macOS, WindowsInstalling and using GraalVM CE components like js
components-oracleBazel 7N/ALinux, macOS, WindowsInstalling and using Oracle GraalVM components like js
maven-artifactsBazel 7N/ALinux, macOS, WindowsUsing GraalVM Maven artifacts with rules_jvm_external
legacy-gvmBazel 7 with WORKSPACELegacyLinux, macOSExample modern rules with older GraalVM version (22.1.0, Java 11)
legacy-rulesBazel 5+ with WORKSPACELegacyLinux, macOSExample legacy rules with older GraalVM version (22.1.0, Java 11)

Specific version notes

See below for use notes with specific versions of bazel.

Bazel 5

Bazel 5 seems to have issues with the stricter build environment configurations offered by these rules. If you see issues with DEVELOPER_DIR on macOS, or issues resolving Visual Studio on Windows, you should try the legacy rules.