About this project

jBox2D provides Java language bindings for the Box2D 2D physics engine, enabling use across desktop (Windows, Linux, macOS), Android, and web platforms. It supports multiple native backends including JNI, Java FFM (Foreign Function & Memory API), TeaVM C, and WebAssembly. The library offers platform-neutral core APIs and runtime-specific artifacts for each target environment. Integration with libGDX is included as a jBox2D artifact, while libfdx support is provided through a separate extension published by the libFDX project. Bindings are generated from a WebIDL contract to maintain close alignment with upstream Box2D. Sample applications port official Box2D demos and run on all supported platforms using either libGDX or libfdx frontends, which support OpenGL, WebGPU, and Vulkan where available. The API follows Box2D’s handle-based ownership model and includes converters that avoid temporary allocations during rendering loops. Documentation covers building from source, running samples, and reviewing the binding contract. While functional and actively developed, APIs may change between releases. Licensed under Apache 2.0; upstream Box2D is MIT licensed.