Installation Guide
Download Process
Basic Download
use lighty_java::{JavaDistribution, jre_downloader};
use std::path::Path;
#[tokio::main]
async fn main() {
let runtime_dir = Path::new("./runtimes");
let java_path = jre_downloader::jre_download(
runtime_dir,
&JavaDistribution::Temurin,
&21,
|current, total| {
let percent = (current * 100) / total;
println!("Download: {}%", percent);
}
).await.unwrap();
println!("Java installed at: {}", java_path.display());
}With Progress Tracking
With Event System
Installation Flow
Directory Structure
Before Installation
After Installation
Finding Existing Installation
Installation Naming
Archive Extraction
Windows (ZIP)
Linux/macOS (TAR.GZ)
Binary Location
Permissions (Unix)
Error Handling
Download Errors
Network Retry
Disk Space Requirements
Distribution
Java 8
Java 11
Java 17
Java 21
Cleanup
Concurrent Downloads
See Also
Last updated