ristretto_classloader

Crates.ioristretto_classloader
lib.rsristretto_classloader
version
sourcesrc
created_at2024-08-09 05:02:04.100473
updated_at2024-12-13 01:23:16.62567
descriptionA library for loading Java classes.
homepage
repositoryhttps://github.com/theseus-rs/ristretto
max_upload_size
id1330444
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Brian Heineman (brianheineman)

documentation

README

Ristretto ClassLoader

ci Documentation Code Coverage Benchmarks Latest version License Semantic Versioning

Getting Started

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

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

VSCode Development Container
GitHub Codespaces
Commit count: 526

cargo fmt