install-jdk is a Python library that simplifies the process of installing OpenJDK distributions. It supports popular OpenJDK builds from Adoptium (formerly AdoptOpenJDK), Amazon Corretto, and Zulu, allowing developers to easily manage Java environments. The current version is 1.1.0, and it maintains a moderate release cadence with updates for dependencies and minor features.
pip install install-jdkVerified import paths — ran on the pinned version, not inferred.
This quickstart installs the latest OpenJDK 17 from Adoptium to a specified directory (defaulting to a temporary path to avoid permissions issues). It demonstrates the core `jdk.install()` function and prints the installation path. Users would typically use this `install_path` to configure their `JAVA_HOME` environment variable or invoke the Java executable directly.
After `jdk.install()` returns the `install_path`, manually set your `JAVA_HOME` environment variable to this path and add `$JAVA_HOME/bin` to your system's PATH. For example, `export JAVA_HOME=/path/to/installed/jdk`.
Ensure you are using a compatible Python version (3.6-3.9). It is recommended to use a virtual environment with the correct Python interpreter version for `install-jdk`.
Verify your internet connection. If you are behind a corporate proxy, ensure your Python environment's proxy settings (e.g., `HTTP_PROXY`, `HTTPS_PROXY` environment variables) are correctly configured.
Always specify the `jvm_impl` argument, e.g., `jdk.install('11', jvm_impl='corretto')`, to ensure you get the desired JDK distribution.Run `pip install install-jdk` in your active virtual environment or global Python installation.
Double-check the exact version string (e.g., use '8' instead of '1.8' for Java 8, or '17' for Java 17). Verify the `jvm_impl` (e.g., 'adoptium', 'corretto', 'zulu') and `jvm_variant` (e.g., 'hotspot', 'openjdk') are correct and supported.
Run the script with appropriate user permissions, or specify an `install_dir` where the user has write access, e.g., `jdk.install('17', install_impl='adoptium', install_dir='/tmp/my_jdks')`.No dependency data recorded yet.