#java #install #api-bindings

corretto

Library for installing and finding info about Corretto OpenJDK

1 unstable release

0.1.0 Oct 1, 2023

#165 in #java

MIT/Apache

14KB
236 lines

Library for installing and finding info about Corretto OpenJDK

Crates.io Downloads Documentation License Dependency Status

Get programmatic access to the Corretto OpenJDK distributions.

According to Amazon,

Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK). Corretto comes with long-term support that includes performance enhancements and security fixes. Corretto is certified as compatible with the Java SE standard and is used internally at Amazon for many production services. With Corretto, you can develop and run Java applications on operating systems such as Amazon Linux 2, Windows, and macOS.

Usage

use corretto::{VersionInfo, Version, Os, CpuArch, Ext, JdkDesc, DownloadError};

#[tokio::main]
async fn main() -> Result<(), DownloadError> {
    let version_info = VersionInfo::fetch().await?;
    let latest_lts = version_info.latest_lts();
    let jdk_desc = JdkDesc::new(
        latest_lts,
        CpuArch::X64,
        Os::Linux,
        Ext::TarGz,
    );
    let download_url = jdk_desc.url();
    let path = download_url.download_tmp().await?;
    // ..
    Ok(())
}

Dependencies

~8–22MB
~332K SLoC