Java bindings for wgpu-native using Project Panama.
- Java 22+
- jextract (for generating bindings)
- macOS, Linux, or Windows (x86_64/aarch64)
Option 1: Automatic
Gradle will install jextract
automatically if it is not found in your system PATH or JEXTRACT_HOME
environment variable.
./gradlew downloadJextract
Option 2: Manual Installation
- Download the appropriate build for your platform from jdk.java.net/jextract
- Extract to a standard location:
- Linux/macOS:
~/.local/jextract
or/usr/local/jextract
- Windows:
%USERPROFILE%\AppData\Local\Programs\jextract
orC:\Program Files\jextract
- Linux/macOS:
- Add the
bin
directory to your PATH, or setJEXTRACT_HOME
environment variable - On macOS: Run
sudo xattr -r -d com.apple.quarantine /path/to/jextract
to remove quarantine
./gradlew downloadWgpuNative
./gradlew generateBindings
./gradlew build
Run the triangle example:
cd wgpu4j-examples
../gradlew run
See the examples for usage patterns.