https://github.com/activeviam/jdk4py
A JDK shipped in a Python package
https://github.com/activeviam/jdk4py
java jdk jre jvm python-library runtime
Last synced: 6 months ago
JSON representation
A JDK shipped in a Python package
- Host: GitHub
- URL: https://github.com/activeviam/jdk4py
- Owner: activeviam
- License: gpl-2.0
- Created: 2020-03-16T10:16:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T16:14:08.000Z (9 months ago)
- Last Synced: 2025-04-02T11:55:05.956Z (6 months ago)
- Topics: java, jdk, jre, jvm, python-library, runtime
- Language: Python
- Homepage:
- Size: 174 KB
- Stars: 20
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jdk4py
A JDK shipped in a Python package.
[](https://badge.fury.io/py/jdk4py)
## Install
```bash
pip install jdk4py
```or as a Conda package:
```bash
conda config --add channels https://conda.atoti.io
conda install jdk4py
```## Usage
```python
>>> from jdk4py import JAVA, JAVA_HOME, JAVA_VERSION
>>> JAVA_HOME
PosixPath('/Users/johndoe/dev/jdk4py/jdk4py/java-runtime')
>>> JAVA
PosixPath('/Users/johndoe/dev/jdk4py/jdk4py/java-runtime/bin/java')
>>> JAVA_VERSION
(21, 0, 4)
>>> from subprocess import run
>>> some_java_options = ["-Xmx16G", "-Xms2G"]
>>> run(
... [JAVA, "-jar", "HelloWorld.jar", *some_java_options],
... capture_output=True,
... check=True,
... text=True,
... ).stdout.strip()
"Hello, World!"
```## Versioning
`jdk4py`'s version contains 4 numbers:
- The first 3 numbers correspond to the JDK version.
- The fourth number is the library API version.