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.10.

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.5.0.tar.gz (144.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cjdk-0.5.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cjdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c83bdb06749a2cdee8e0c9ca1612e10b629286a0a48115ecc2e892e072d5315a
MD5 e853c5a4a0b2ffd1e0dde34a58d6f551
BLAKE2b-256 121b9203dbc890918e65b3917b1c0715cccdc8a4cd13f56ed12dca0727f8007f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cjdk-0.5.0.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.5.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cjdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4c563afe9fe9e2841c734b5919bb6e31f371220a1cf23a037642d7ccad59b03
MD5 9b58c093c0feb21a4ca6438c62aac3d8
BLAKE2b-256 b6fed8d293c0d88ee6e1d6882039e577d20282535baa45bfa9525f709ebd26a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for cjdk-0.5.0-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page