Crates.io | corretto |
lib.rs | corretto |
version | 0.1.0 |
source | src |
created_at | 2023-10-01 23:53:21.696917 |
updated_at | 2023-10-01 23:53:21.696917 |
description | Library for installing and finding info about Corretto OpenJDK. |
homepage | |
repository | https://github.com/JohnScience/corretto |
max_upload_size | |
id | 989509 |
size | 13,393 |
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.
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(())
}