Skip to content
/ cjdk Public
forked from cachedjdk/cjdk

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

License

Notifications You must be signed in to change notification settings

ctrueden/cjdk

 
 

Repository files navigation

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

pip install cjdk

Licensing

cjdk is distributed under the MIT license. Please see LICENSE.txt.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%