35 releases (breaking)

Uses new Rust 2024

0.29.0 Feb 8, 2026
0.27.0 Dec 13, 2025
0.26.0 Aug 21, 2025
0.25.0 Jul 31, 2025
0.12.0 Nov 29, 2024

#291 in Filesystem


Used in 4 crates (3 directly)

Apache-2.0 OR MIT

2.5MB
48K SLoC

Ristretto ClassLoader

Documentation Code Coverage Benchmarks Latest version License Semantic Versioning

Implementation of a JVM Class Loader that is used to load Java classes. Classes can be loaded from the file system or from a URL; jar and modules are supported. A runtime Java class loader can be created from any version of AWS Corretto. The runtime class loader will download and install the requested version of Corretto and create a class loader that can be used to load Java classes.

The AWS Corretto runtime is installed in the following directory:

  • Unix: $HOME/.ristretto/<version>
  • Windows: %USERPROFILE%\.ristretto\<version>

Examples

use ristretto_classloader::{ClassLoader, ClassPath, Result};
use std::sync::Arc;

fn main() -> Result<()> {
    fn main() -> Result<()> {
        let (version, class_loader) = runtime::class_loader("21")?;
        let class_name = "java.util.HashMap";
        println!("Loading {class_name} from Java runtime {version}");
        let class = class_loader.load(class_name)?;
        println!("{class:?}");
        Ok(())
    }
}

Feature flags

The following features are available:

Name Description Default?
url Enables url class path entries No

Dependencies

~18–40MB
~529K SLoC