Skip to main content

Auto-download JDK or JRE and run Java apps from Python or CLI

Project description

cjdk

cjdk (for "cached JDK") is a Python package and command-line tool to download and run JDK (Java Development Kit) or JRE (Java Runtime Environment) distributions.

Previously used JDKs are kept in the user's cache directory, so that future invocations do not require a download.

What for

  • Installing exact JDK versions for reproducible testing
  • Working with multiple versions of JDKs
  • Deploying tools that require Java

Using the command-line interface of cjdk, you can run Java programs using a one-liner, without having to worry about whether the user has installed a new enough Java runtime and set JAVA_HOME and PATH to appropriate values.

For example, the following command will run Checkstyle using Temurin JRE 17 (which will be downloaded if this is the first time it is requested):

cjdk --jdk=temurin-jre:11 exec java -jar checkstyle-10.3-all.jar -c style.xml MyApp.java

See the documentation for detailed usage.

cjdk was inspired by Coursier's java command, and uses Coursier's JDK index). Unlike Coursier, cjdk does not require a Java runtime to bootstrap.

Installing

cjdk requires Python 3.9.

pip install cjdk

Documentation

Licensing

cjdk is distributed under the MIT license. Please see LICENSE.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

cjdk-0.4.1.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

cjdk-0.4.1-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file cjdk-0.4.1.tar.gz.

File metadata

  • Download URL: cjdk-0.4.1.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cjdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 908c93f305c14e9e9aca52512b8ab20f78c764928201fb2960c4d68dd9ad8735
MD5 ff1e7e2fa7bad6e6ac7f434c4d5129fa
BLAKE2b-256 cebd175d20937665964799cf16651def9d279d7eba6403c6f5f9e5268db567fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cjdk-0.4.1.tar.gz:

Publisher: ci.yml on cachedjdk/cjdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cjdk-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: cjdk-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cjdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51fb2456c39cf7016791382f7adeb2b722ff48973d18c17fd4e6166f4f14b961
MD5 9f99b9fe339780e70e976977f7bcd357
BLAKE2b-256 569dd8090552e532684f3881e2843f9defb1c664ecd905034f1d0e15695fa052

See more details on using hashes here.

Provenance

The following attestation bundles were made for cjdk-0.4.1-py3-none-any.whl:

Publisher: ci.yml on cachedjdk/cjdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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