Skip to content

artagon/homebrew-jdkvalhalla

Repository files navigation

homebrew-jdkvalhalla

Homebrew tap for JDK Project Valhalla early-access builds with automated updates, CI/CD, and support for both macOS and Linux. Currently provides JDK 26 and JDK 27 Valhalla builds.

Release Validate License: GPL v2 with Classpath Exception

About Project Valhalla

Project Valhalla is an OpenJDK project focused on improving Java's performance and memory efficiency through fundamental language enhancements.

What Does Valhalla Provide?

Value Classes and Objects (JEP 401) - The cornerstone of Project Valhalla:

  • Value Classes: New type of class that represents pure data without object identity
  • Flattened Memory Layout: Value objects stored directly in memory without indirection (no object header overhead)
  • Improved Cache Locality: Better CPU cache performance through memory layout control
  • Zero-Cost Abstraction: High-level abstractions without runtime overhead
  • Enhanced Generics: Support for specialized generics over primitive and value types

Performance Benefits

  • Reduced Memory Footprint: Value objects eliminate object headers, reducing memory usage by 50-80% for small objects
  • Improved Cache Performance: Direct memory layout means fewer cache misses
  • Better GC Performance: Fewer object references mean less garbage collection pressure
  • Faster Array Operations: Arrays of value types stored contiguously without indirection

Use Cases

Valhalla is particularly beneficial for:

  • High-performance computing and scientific applications
  • Financial systems requiring low latency
  • Game engines and graphics processing
  • Big data processing and analytics
  • Any application with large collections of small objects (e.g., Point, Complex, Vector2D)

This tap provides the latest Project Valhalla early-access builds implementing JEP 401.

Quick Start

Add the Tap

brew tap Artagon/jdkvalhalla

Cask Installation (macOS) -- Latest (JDK 27)

brew install --cask jdkvalhalla

The cask installation places JDK in /Library/Java/JavaVirtualMachines/jdk-valhalla.jdk and integrates with macOS's Java management system. The cask always tracks the latest Valhalla build (currently JDK 27).

Formula Installation (macOS/Linux)

# Install JDK 27 Valhalla (latest)
brew install jdkvalhalla@27

# Install JDK 26 Valhalla (older)
brew install jdkvalhalla@26

The formula installation creates symlinks in your Homebrew bin directory.

Current Versions

Build Version Formula / Cask
JDK 27 Valhalla 27-jep401ea3+1-1 jdkvalhalla@27 / jdkvalhalla (cask)
JDK 26 Valhalla 26-jep401ea2+1-1 jdkvalhalla@26

Both builds implement:

  • JEP 401: Value Classes and Objects

What Changed Between Builds

JDK 27 Valhalla (27-jep401ea3+1-1) — Released 2026/3/11

  • Based on JDK 27 (up from JDK 26)
  • Third EA iteration of JEP 401 (jep401ea3)
  • Includes JDK 27 language and API changes alongside Valhalla features

JDK 26 Valhalla (26-jep401ea2+1-1) — Released 2025/10/10

  • Based on JDK 26
  • Second EA iteration of JEP 401 (jep401ea2)

Features

  • Automatic Updates: Weekly checks for new Valhalla builds with automated formula/cask updates
  • Multi-Platform Support:
    • macOS: ARM64 (Apple Silicon) and x64 (Intel)
    • Linux: ARM64 (aarch64) and x64
  • CI/CD Validation: Automated testing on every commit across all supported platforms
  • GitHub Releases: Automatic release creation when new versions are detected
  • Flexible Installation: Choose between cask (macOS system integration) or formula (Homebrew-managed) installation
  • Integrity Verification: SHA-256 checksum validation for all downloads

Platform Support

Platform Architecture Cask Formula Status
macOS 13+ ARM64 (Apple Silicon) Fully Tested
macOS 13+ x64 (Intel) Fully Tested
Linux ARM64 (aarch64) Fully Tested
Linux x64 Fully Tested

Note: Cask installation is macOS-only and integrates with the system's Java framework at /Library/Java/JavaVirtualMachines/. Formula installation works on both macOS and Linux, placing files in the Homebrew prefix.

Usage

Setting JAVA_HOME

After installation, you may want to set JAVA_HOME:

For cask installation:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-valhalla.jdk/Contents/Home"

For formula installation:

export JAVA_HOME="$(brew --prefix jdkvalhalla@27)"

Verifying Installation

java -version
# JDK 27: openjdk version "27-jep401ea3" ...
# JDK 26: openjdk version "26-jep401ea2" ...

Using Value Classes (JEP 401)

Project Valhalla introduces value classes that provide better performance and memory efficiency:

// Enable preview features to use value classes
javac --enable-preview --release 27 MyValueClass.java
java --enable-preview MyValueClass

Updating

The tap is automatically updated with new Valhalla builds. To update to the latest version:

brew update
brew upgrade jdkvalhalla@27  # or brew upgrade --cask jdkvalhalla

Issue Reporting

Found a problem? Open an issue using our issue templates.

Automated Updates

This repository uses GitHub Actions to automatically maintain the latest Valhalla builds:

Update Workflow

  1. Weekly Checks (Sundays at 12:00 UTC): Automated script checks jdk.java.net/valhalla for new builds
  2. Multi-Platform Download: Downloads and verifies binaries for all supported platforms:
    • macOS: ARM64 and x64
    • Linux: ARM64 and x64
  3. SHA-256 Verification: Calculates checksums for all platform binaries
  4. Automated PR Creation: Creates pull request with updated formula/cask when new version detected
  5. CI/CD Validation: Runs comprehensive tests across all platforms:
    • Syntax validation for Ruby code
    • Installation tests on macOS 13, macOS 14, Ubuntu 22.04, Ubuntu 24.04
    • Runtime verification (Java version check and basic compilation)
  6. Auto-Merge: PR automatically merges after passing all tests
  7. GitHub Release: Creates tagged release with version notes

Manual Trigger

You can manually trigger an update check:

# Via GitHub CLI
gh workflow run update.yml -R Artagon/homebrew-jdkvalhalla

Or visit the Actions tab and click "Run workflow".

Project Valhalla Resources

Official Documentation

Technical Specifications

Talks and Presentations

Community and Support

Experimental Features

Remember that Valhalla builds include preview features requiring the --enable-preview flag:

javac --enable-preview --release 27 YourCode.java
java --enable-preview YourClass

License

This tap is distributed under the same license as OpenJDK (GPL-2.0 with Classpath Exception).

Disclaimer

These are early-access builds provided for testing and development purposes. They implement experimental features that are subject to change. They are not intended for production use. For production environments, please use stable JDK releases.

Important: Project Valhalla builds include preview features that require the --enable-preview flag to use. The APIs and language features are subject to change in future releases.

Links

About

Homebrew tap for Project Valhalla JDK early-access builds (JEP 401: Value Classes and Objects). Multi-platform support (macOS ARM64/x64, Linux ARM64/x64). Currently provides JDK 26 and JDK 27 Valhalla builds with automated updates and CI/CD.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors