https://github.com/cachedjdk/cjdk
Auto-download JDK or JRE and run Java apps from Python or CLI
https://github.com/cachedjdk/cjdk
cache cli java jdk jre python
Last synced: 3 months ago
JSON representation
Auto-download JDK or JRE and run Java apps from Python or CLI
- Host: GitHub
- URL: https://github.com/cachedjdk/cjdk
- Owner: cachedjdk
- License: mit
- Created: 2022-06-21T20:19:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T21:19:03.000Z (4 months ago)
- Last Synced: 2025-04-10T00:43:28.992Z (3 months ago)
- Topics: cache, cli, java, jdk, jre, python
- Language: Python
- Homepage: https://cachedjdk.github.io/cjdk/latest/
- Size: 6.64 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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 JavaUsing 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](https://checkstyle.org/) using Temurin JRE 17 (which will be
downloaded if this is the first time it is requested):```sh
cjdk --jdk=temurin-jre:11 exec java -jar checkstyle-10.3-all.jar -c style.xml MyApp.java
```See the [documentation](https://cachedjdk.github.io/cjdk/latest) for detailed
usage.**cjdk** was inspired by [Coursier](https://get-coursier.io/)'s
[`java`](https://get-coursier.io/docs/cli-java) command, and uses Coursier's
[JDK index](https://github.com/coursier/jvm-index)). Unlike Coursier, **cjdk**
does not require a Java runtime to bootstrap.## Installing
**cjdk** requires Python 3.9.
```sh
pip install cjdk
```## [Documentation](https://cachedjdk.github.io/cjdk/latest)
## Licensing
**cjdk** is distributed under the MIT license. Please see LICENSE.txt.