ristretto javac

Install v0.35.0

Published on Nov 5 2026 at 15:44 UTC
View all installation options
View all installation options

Ristretto javac

Code Coverage Latest version License Semantic Versioning

ristretto_javac provides a javac command-line program backed by the JDK compiler hosted by the Ristretto virtual machine.

cargo install ristretto_javac
javac -d classes HelloWorld.java

Rust applications can reuse the compiler through ristretto_vm:

use ristretto_vm::{Compiler, CompilerError};

#[tokio::main]
async fn main() -> Result<(), CompilerError> {
    let compiler = Compiler::default().await?;
    compiler.compile(&["-d", "classes", "HelloWorld.java"]).await?;
    Ok(())
}

Pass a ristretto_vm::Configuration to Compiler::new to select a Java home or version, redirect the compiler streams, or customize VM behavior. CompilerError preserves standard javac failure categories and exit codes. The Rust API can also compile one or more source strings entirely in memory and return every generated class.