Lottie Animations for Java & JavaFX

Parse, generate & play Lottie animations natively in JavaFX.
No WebView required.

Latest release: v1.2.4 · 2026-06-15

Get Started View on GitHub

Lottie4J is an open-source Java library that parses Lottie animations into Java objects and plays them as native JavaFX animations — no WebView, no browser engine, no JavaScript bridge.

Quick start

Lottie4J requires Java 21 or higher and is available from Maven Central. Add the fxplayer dependency (it includes the core library):

<dependency>
    <groupId>com.lottie4j</groupId>
    <artifactId>fxplayer</artifactId>
    <version>1.2.4</version>
</dependency>
implementation("com.lottie4j:fxplayer:1.2.4")
implementation 'com.lottie4j:fxplayer:1.2.4'

Then load a Lottie file and drop the player into your scene:

Animation animation = LottieFileLoader.load(new File("animation.json"));
stage.setScene(new Scene(new LottiePlayer(animation),
        animation.width(), animation.height()));
stage.show();

See the code examples for the full, runnable application and the core-only (parse/generate) usage.

Why Lottie4J

Native JavaFX rendering
Drawn straight to a JavaFX Canvas. No browser, no JS bridge. It’s just a Node.
Parse & generate
Read Lottie JSON into typed Java objects, and write valid Lottie files back out.
Modern, minimal Java
Built on Java 21 LTS with Records — a small, maintainable codebase.
Lightweight & offline-first
Needs only javafx.graphics. Fast startup, tiny jlink footprint, no network.

Wondering how this compares to embedding a browser? Read Lottie4J vs WebView.

The sources of this project are available on github.com/lottie4j/lottie4j.

Watch: an introduction to Lottie4J — playing Lottie animations natively in JavaFX.

Learn About Lottie

New to Lottie? Check out our introduction to the Lottie format to learn about this powerful animation format, its capabilities, and available resources.

Current status

Lottie4J is released and under active development. The library can parse Lottie files into Java objects, generate Lottie files from Java objects, and play animations in JavaFX, including keyframe interpolation, animated properties, shape rendering, fills and gradients, stroke styling, trim paths, layer transforms and parenting. It already handles many complex real-world animations.

Follow the progress in the status posts and check the release notes for the latest changes.