Crates.io | ristretto_classloader |
lib.rs | ristretto_classloader |
version | |
source | src |
created_at | 2024-08-09 05:02:04.100473 |
updated_at | 2024-12-13 01:23:16.62567 |
description | A library for loading Java classes. |
homepage | |
repository | https://github.com/theseus-rs/ristretto |
max_upload_size | |
id | 1330444 |
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` |
size | 0 |
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:
$HOME/.ristretto/<version>
%USERPROFILE%\.ristretto\<version>
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(())
}
}
The following features are available:
Name | Description | Default? |
---|---|---|
url |
Enables url class path entries | No |
This crate uses #![forbid(unsafe_code)]
to ensure everything is implemented in 100% safe Rust.
Licensed under either of
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.