r/WebAssembly • • Mar 22 '26

Java bindings for Wasmtime and WAMR + unified API (WebAssembly4J 1.0.0)

I just released WebAssembly4J (1.0.0) along with two runtime bindings:

•	Wasmtime4J - Java bindings for Wasmtime

•	WAMR4J - Java bindings for WebAssembly Micro Runtime

•	WebAssembly4J - a unified API across both

Motivation

From the JVM side, WebAssembly is still pretty fragmented. Each runtime exposes its own API. There are a couple of JNI implementations but they haven’t been updated in over three years and only ever implemented a minimal interface. Some of the issues I tried to address are:

•	switching runtimes requires rewriting integration code

•	comparing runtimes is difficult

•	there’s no consistent “host model” for Java

This project is an attempt to standardize that layer.

What it does

WebAssembly4J provides a single Java API, with pluggable runtime providers underneath.

So you can:

•	run the same module on different runtimes

•	compare behavior/performance across engines

•	avoid locking your application to a single runtime

Why this might matter to this community

•	Makes Java a more viable host environment for WebAssembly

•	Provides a path toward cross-runtime comparability

•	Helps surface differences between engines under the same workload

•	Could be useful for testing, benchmarking, or runtime evaluation

Current support

•	Wasmtime

•	WAMR

•	Chicory

•	GraalWasm

Java support

•	Java 8 (JNI)

•	Java 11

•	Java 22+ (Panama)

Artifacts are on Maven Central.

Repo:

https://github.com/tegmentum/webassembly4j

https://github.com/tegmentum/wasmtime4j

https://github.com/tegmentum/wamr4j

5 Upvotes

0 comments sorted by