Python Glossary Русский

all Python 3until 3.15Removed from the standard libraryfunction

platform.java_ver()

removed

Java VM details for Jython. Removed in Python 3.15 — use platform.python_implementation() instead.

Syntax

platform.java_ver()  # до 3.15

The function only made sense under Jython, where it returned the Java version and vendor; on CPython it gave a tuple of empty strings. It was removed because it worked on a single implementation, had a confusing interface and was barely tested. To migrate, call platform.python_implementation() to learn what the code runs on — it returns 'CPython', 'PyPy' or 'Jython'; under Jython read the Java details from java.lang.System.getProperty('java.version').

Examples

# Python 3.15+
import platform
try:
    platform.java_ver
except AttributeError as e:
    print(type(e).__name__)  # → AttributeError
# Python 3.15+
import platform
print(platform.python_implementation())  # → CPython
import platform
release, vendor, vminfo, osinfo = platform.java_ver()
print(repr(release), repr(vendor))  # → '' '' — в CPython пусто

See also

Common errors

Open in the full glossarydocs.python.orgReport an inaccuracy