Skip to main content

Installs AdoptOpenJDK Java

Project description

install-jdk

A simple python utility that can be used to download and install a give Java JDK or JRE. Utilizes the AdoptOpenJDK API.

This is a port of from the GitHub Action installjdk

Currently supports 32-bit and 64-bit versions of Windows, Linux, and macOS.

Install

pip install install-jdk

Usage

import jdk

jdk.install('11')
# Platform dependent install of Java JDK 11 into $HOME/.jdk/<VERSION>

jdk.install('11', impl=jdk.Implementation.OPENJ9)
# Platform dependent install of Java JDK 11 with OpenJ9 into $HOME/.jdk/<VERSION>

jdk.install('11', jre=True)
# Platform dependent install of Java JRE 11 into $HOME/.jre/<VERSION>

print(jdk.OS)       # Detected platform operating system
print(jdk.ARCH)     # Detected platform CPU architecture

download_url = jdk.get_download_url('11')
print(download_url)
# Obtains the platform dependent JDK download url

download_url = jdk.get_download_url('11', jre=True)
print(download_url)
# Obtains the platform dependent JRE download url

jdk.uninstall('11')
# Removes the Java 11 JDK if installed

jdk.uninstall('11', jre=True)
# Removes the Java 11 JRE if installed

Development

Targets Python3.6 and newer.

git clone https://github.com/jyksnw/install-jdk
cd install-jdk
python3 -m venv .env
source .env/bin/activate

pip install -r dev_requirements.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

install-jdk-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file install-jdk-0.1.0.tar.gz.

File metadata

  • Download URL: install-jdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for install-jdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a76eae0d49e39affde5af128321079be4f73aa91c6a5cfa566dcee17f9f45a18
MD5 b9d3c2b8a4a48c0330a19fcae225064a
BLAKE2b-256 8e975aac9464d7d981d69820bf2438bddf992e4bb83187ce1aee5fff4cd8ea62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page