skillfed

jdk4py

A JDK shipped in a Python package

jdk4py v25.0.2.1 358.9K downloads/30d#7,256 on PyPI27
Copyleft license Active released

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 jdk4py

uv

uv add jdk4py

poetry

poetry add jdk4py

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: GNU General Public License v2 (GPLv2)Operating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3

Tags

java runtime in pythonjdk python packagerun java from pythonembedded jdkjava executable python
java-interopruntime-bundling

More Build Tools packages