py4j
Enables Python programs to dynamically access arbitrary Java objects
Decision gist · record as of 2026-08-14
Yes, if you need Python-Java interoperability and can verify compatibility with your Java and Python versions. The package is mature, permissively licensed, installs with no dependencies, and has no known vulnerabilities. However, its dormant status (576 days since last release) means no recent bug fixes or feature updates; confirm it works with your target Python and JVM versions before committing to a production deployment.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a Java Virtual Machine running and accessible; the JavaGateway must connect to a JVM process, typically started separately or via py4j's launch utilities.
- Installation is straightforward with no runtime dependencies.
- The package is dormant (576 days since last release), though it remains in the top 1000 by download volume and carries a Beta development status.
License · maintenance · safety
BSD License (permissive) — Licensed under the BSD License (permissive), so you may use, modify, and distribute the package with minimal restrictions beyond attribution.
last release 2025-01-15 (576 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 111,317,505 downloads/mo, #319 on PyPI
Alternatives
Verify before relying
pip install py4j
from py4j.java_gateway import JavaGateway
gateway = JavaGateway()
java_object = gateway.jvm.java.lang.String("hello")- Whether the package works reliably with Python 3.10, 3.11, and 3.12 despite dormant maintenance status.
- Current state of Java version compatibility and any known issues with modern JVM releases.
- Whether callback functionality (Java calling Python) is production-ready or carries known limitations.
What it is and what it does
Py4J is a bridge library that lets Python code call Java objects and methods directly, treating them as if they were Python objects. It also supports the reverse: Java code can invoke Python objects. The library handles method dispatch, type conversion, and collection access across the language boundary, making it possible to integrate Python scripts with Java libraries and applications without writing wrapper code.
The package has been stable since its early releases and remains widely downloaded, but is currently dormant—no active development or recent updates. It works with Python 2 and Python 3.8 through 3.12, and requires a running JVM to connect to. For projects that need deep Java integration from Python, Py4J is a mature option; for new projects, you should verify that its age and lack of recent maintenance align with your Java and Python versions.
Use it for
- Integrate Python data science workflows with existing Java libraries or enterprise systems.
- Call Java methods from Python scripts without writing C extensions or subprocess wrappers.
- Build Python frontends that drive Java backend services or access Java APIs directly.
- Enable Java applications to invoke Python logic for scripting, machine learning, or dynamic computation.
- Prototype or test Java code from Python without recompiling or restarting the JVM.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need Python-Java interoperability and can verify compatibility with your Java and Python versions.
The package is mature, permissively licensed, installs with no dependencies, and has no known vulnerabilities. However, its dormant status (576 days since last release) means no recent bug fixes or feature updates; confirm it works with your target Python and JVM versions before committing to a production deployment.
Install
py4j on PyPI
Before you install
Installation is straightforward with no runtime dependencies. The package is dormant (576 days since last release), though it remains in the top 1000 by download volume and carries a Beta development status.
Requires a Java Virtual Machine running and accessible; the JavaGateway must connect to a JVM process, typically started separately or via py4j's launch utilities.
License in practice
Licensed under the BSD License (permissive), so you may use, modify, and distribute the package with minimal restrictions beyond attribution.
Quickstart
pip install py4j
from py4j.java_gateway import JavaGateway
gateway = JavaGateway()
java_object = gateway.jvm.java.lang.String("hello")
Verify before relying
- Whether the package works reliably with Python 3.10, 3.11, and 3.12 despite dormant maintenance status.
- Current state of Java version compatibility and any known issues with modern JVM releases.
- Whether callback functionality (Java calling Python) is production-ready or carries known limitations.
Package facts
| License | BSD License permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 576 days since the last release |
| First released | |
| Downloads | 111,317,505 / month, #319 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: JavaProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Object Brokering |
Evidence: py4j-0.10.9.9-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “call java from python”
- py4jPy4J enables Python programs to dynamically call Java objects and…
- pemjaPemJa enables Python code to call Java methods and classes, and Java…
- pyjniusPyJNIus lets Python code call Java classes and methods directly using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also jpype1 · mulpyplexer · pemja · pyjks · Pyro5 · juliacall · jdk4py · java-access-bridge-wrapper · Pyro4 · cppyy-cling