Installation

Requirements

  • Java 17+ (this binding targets Java 25 LTS by default; see the pom.xml maven.compiler.release property)

As a standalone dependency

Add the Maven coordinate to your pom.xml:

<dependency>
    <groupId>io.github.thisisamirv</groupId>
    <artifactId>fastlowess</artifactId>
    <version>5.1.0</version>
</dependency>

The published jar bundles prebuilt native libraries for linux-x86_64, linux-x86_64-musl (Alpine), linux-aarch64, linux-aarch64-musl (Alpine), macos-x86_64, macos-aarch64, windows-x86_64, and windows-aarch64 (see NativeBridge’s `osArchDir()); NativeBridge auto-detects your platform and libc (checking for Alpine’s /etc/alpine-release and musl’s ld-musl-* dynamic linker), extracts the matching one to a temp file, and loads it — no separate native library installation needed on any of those platforms.

To override the bundled library (e.g. a custom or GPU-enabled build), either system property takes precedence:

java -Dfastlowess.native.path=/path/to/libfastlowess_java.so -cp your-app.jar com.example.Main
# or point at a directory instead of an exact file:
java -Dfastlowess.native.dir=/path/to/native/lib -cp your-app.jar com.example.Main

Build the native library yourself from the lowess-project source:

git clone https://github.com/thisisamirv/lowess-project
cd lowess-project
cargo build -p fastlowess-java --release

Within the lowess-project monorepo

If you’re working inside a checkout of lowess-project, the root Makefile handles building the native library for you:

make java        # build the Rust JNI crate, then `mvn package`
make java-dev     # full dev checks: fmt, clippy, export verification, mvn test

NativeBridge loads the native library from the path given by the fastlowess.native.dir system property (or -Dfastlowess.native.dir=…​), which defaults to ../../target/debug relative to bindings/java — where cargo build -p fastlowess-java places the shared library within this repo’s layout.

GPU backend

GPU acceleration is available via the native library’s gpu Cargo feature (wgpu: Vulkan, Metal, DirectX 12, and GLES on Android), but is not enabled in the default build, nor bundled in the published jar. See the C++ binding’s GPU Backend guide for the underlying feature; building fastlowess-java with --features gpu produces a library where FastLowess.gpuEnabled() returns true — point the JVM at it via fastlowess.native.path/fastlowess.native.dir as shown above.