jdk4py
A JDK shipped in a Python package
What it is and what it does
jdk4py packages a Java Development Kit as a Python library, eliminating the need to install Java separately on your system. When you install it via pip, you get a self-contained JDK binary that the package exposes through Python constants: JAVA (the path to the java executable), JAVA_HOME (the JDK root directory), and JAVA_VERSION (a tuple of version numbers). The package is versioned with four numbers—the first three match the bundled JDK version, and the fourth tracks the library's own API changes.
You use it by importing those constants and passing them to subprocess calls or other tools that need to invoke Java. It has no runtime dependencies beyond Python itself, and it ships pre-built wheels for macOS (Intel and ARM), Linux (x86_64 and ARM64), and Windows (x86_64). The project is actively maintained and marked production-stable, with a copyleft GPLv2 license that requires compliance if you redistribute or link it into your own software.
Use it for:
- Run Java JAR files or applications from a Python script without requiring users to install Java separately.
- Build Python tools that wrap or orchestrate Java libraries, passing JVM options like heap size through subprocess.
- Deploy containerized Python applications that need Java runtime without adding a separate JDK layer.
- Test Java code from a Python test suite by invoking the bundled java executable.
- Distribute cross-platform Python packages that depend on Java without asking users to manage JDK installation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Bundles a JDK runtime into a Python package, providing direct access to Java executables and environment variables for running Java applications from Python code.
Yes, if you need to run Java from Python and want to avoid separate JDK installation. The package is actively maintained, production-stable, and supports current Python versions on major platforms. The copyleft license is a consideration for proprietary or redistributed software. Medium install friction (platform-specific wheels, bundled binary) is typical for this use case and not a blocker.
Install
jdk4py on PyPI
pip
pip install jdk4pyuv
uv add jdk4pypoetry
poetry add jdk4pyInstalling jdk4py
Before you install
Medium install friction due to platform-specific wheels (macOS x86_64 and ARM64, Linux aarch64 and x86_64, Windows amd64) and a bundled JDK binary. Actively maintained with recent commits and production-stable status.
License in practice
Licensed under GPLv2 (copyleft). Users must comply with copyleft obligations if they distribute derivative works or link this package into their own software.
Quickstart
pip install jdk4py
from jdk4py import JAVA, JAVA_HOME, JAVA_VERSION
from subprocess import run
result = run([JAVA, "-jar", "app.jar"], capture_output=True, text=True)
print(result.stdout)
Requires Python >= 3.10. Platform-specific wheel must match your OS and architecture (macOS, Linux, or Windows on x86_64 or ARM64).
Verify before relying
- Exact size of the bundled JDK and its impact on installation time or disk usage.
- Whether the package auto-updates the JDK or pins it to a specific version.
- Compatibility with non-standard Python environments (e.g., conda-forge, PyPy).
Package facts
| License | not declared (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 113 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 358,910/month — #7,256 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jdk4py-25.0.2.1-py3-none-macosx_10_9_x86_64.whl; jdk4py-25.0.2.1-py3-none-macosx_11_0_arm64.whl; jdk4py-25.0.2.1-py3-none-manylinux_2_17_aarch64.whl; jdk4py-25.0.2.1-py3-none-manylinux_2_17_x86_64.whl; jdk4py-25.0.2.1-py3-none-win_amd64.whl
Keywords: jdk, java, jvm, jre
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
install-jdkAutomates the download and installation of…
permissive · top 15,000 on PyPI
java-manifestEncode and decode Java's META-INF/MANIFEST.MF…
unclear · top 15,000 on PyPI
pyjksPyJKS loads and manipulates Java KeyStore…
permissive · top 5,000 on PyPI
py4jPy4J enables Python programs to dynamically…
permissive · top 1,000 on PyPI
snowpark-connect-deps-2Provides JAR dependencies for Snowpark Connect,…
permissive · top 15,000 on PyPI
denoPackages and distributes Deno (a…
permissive · top 15,000 on PyPI
java-access-bridge-wrapperWraps the Windows Java Access Bridge to let…
permissive · top 15,000 on PyPI
pemjaPemJa enables Python code to call Java methods…
permissive · top 15,000 on PyPI
jpype1JPype provides Python access to Java classes…
permissive · top 1,000 on PyPI
pyinstallerPyInstaller bundles a Python application and…
copyleft · top 5,000 on PyPI