Write Cardano Smart Contracts
in Java

Compile a safe subset of Java to Plutus V3 UPLC. Familiar language, powerful compiler, efficient on-chain code.

VestingValidator.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 @SpendingValidator public class VestingValidator { record VestingDatum (..) {} @Entrypoint static boolean validate (..) { TxInfo txInfo = ctx.txInfo(); boolean signed = txInfo .signatories() .contains( datum ...); return signed ; } } JuLC compile UPLC 4d01000033222 220051a003375 60ae1b003f5e.. on-chain λ

Why JuLC?

Write Cardano smart contracts in Java — one of the most popular languages in enterprise.

Java Ecosystem

Use your existing IDE, debugger, Maven/Gradle. Billions of Java developers can now write smart contracts.

Type-Safe

Records, sealed interfaces, switch expressions, and exhaustiveness checking catch bugs at compile time.

Debug Like Java

Step through validators in your IDE. Source maps pinpoint exactly where your UPLC crashed on-chain.

Batteries Included

Rich standard library, testkit, Gradle plugin, annotation processor, and cardano-client-lib integration.

Write validators in Java

Familiar syntax, typed ledger access, and pattern matching on datum types. The annotation processor compiles to UPLC during your Gradle build.

VestingValidator.java
@SpendingValidator
public class VestingValidator {
    record VestingDatum(PubKeyHash beneficiary, BigInteger deadline) {}

    @Entrypoint
    static boolean validate(VestingDatum datum, PlutusData redeemer, ScriptContext ctx) {
        TxInfo txInfo = ctx.txInfo();

        boolean signed = txInfo.signatories().contains(datum.beneficiary());

        boolean pastDeadline = IntervalLib.finiteLowerBound(txInfo.validRange())
            .compareTo(datum.deadline()) > 0;

        return signed && pastDeadline;
    }
}

Everything you need

A complete toolchain from writing your first validator to deploying on mainnet.

Java-to-UPLC Compiler

Compiles records, sealed interfaces, switch expressions, lambdas, and loops to efficient Plutus V3 UPLC.

Pluggable VM

Evaluate UPLC locally via SPI. Ships with Scalus and pure-Java backends for testing and cost estimation.

Standard Library

13 on-chain libraries: lists, maps, values, math, crypto, bitwise, intervals, output, address, and more.

Testkit

Test validators locally without a running node. Unit tests, property-based fuzzing, and budget analysis.

IDE Support

Full IntelliJ / VS Code support with autocomplete, error checking, and debugging for validator code.

CLI Toolkit

julc CLI: scaffold projects, compile, test, and explore with an interactive REPL from your terminal.

julc CLI

A complete command-line toolkit. Scaffold, compile, test, and explore.

julc repl
julc new my-project

Scaffold a Java project with validators and tests.

julc build

Compile validators to UPLC and generate CIP-57 blueprints.

julc check

Discover and run on-chain tests — no node required.

julc repl

Interactive REPL with live CPU/memory budgets.

julc blueprint inspect

Inspect blueprints — view UPLC, compute addresses.

Get started in 3 steps

1

Add dependencies

build.gradle
dependencies {
    implementation "com.bloxbean.cardano:julc-stdlib:${julcVersion}"
    implementation "com.bloxbean.cardano:julc-ledger-api:${julcVersion}"
    annotationProcessor "com.bloxbean.cardano:julc-annotation-processor:${julcVersion}"

    testImplementation "com.bloxbean.cardano:julc-testkit:${julcVersion}"
    testRuntimeOnly "com.bloxbean.cardano:julc-vm-scalus:${julcVersion}"
}
2

Write a validator

VestingValidator.java
@SpendingValidator
public class VestingValidator {
    record VestingDatum(PubKeyHash beneficiary, BigInteger deadline) {}

    @Entrypoint
    static boolean validate(VestingDatum datum, PlutusData redeemer, ScriptContext ctx) {
        TxInfo txInfo = ctx.txInfo();

        // Check beneficiary signed
        boolean signed = txInfo.signatories().contains(datum.beneficiary());

        return signed;
    }
}
3

Build and load

Run ./gradlew build — the annotation processor compiles your validator to UPLC. Load at runtime:

java
// Load compiled script at runtime
PlutusV3Script script = JulcScriptLoader.load(VestingValidator.class);

Modular architecture

Pick the modules you need. Every component is independently versioned and published to Maven Central.

julc-compiler

Java source to UPLC compiler

julc-stdlib

13 on-chain standard libraries

julc-testkit

Local validator testing & fuzzing

julc-vm

Pluggable VM with Scalus backend

julc-cli

CLI: scaffold, compile, REPL

julc-gradle-plugin

Build integration & annotation processing