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 now 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.8.

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

Uploaded Source

Built Distribution

cjdk-0.3.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cjdk-0.3.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cjdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9316b64bb3e30289b38a149d5012511b60f086f7070e20368733f35078f6f326
MD5 ddf64f22d91afbac4c1c56c9c175fc4f
BLAKE2b-256 a64320dea1ba2721b4d05adf98eebe592e61c10226693009d2c8faf899ac00af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cjdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for cjdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c733e63209554495c585ecd3fc6a65e2d92ce31cd1c259a5ef56c7cbbe6e1286
MD5 d2ceb631b55def1dba20cc5ed8da5a45
BLAKE2b-256 c72bf51177f4f5c20cf09da721ec0565885a25e1d8b152fb1e8ba604d8467b95

See more details on using hashes here.

Supported by

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