๐ŸŒ
Jython
jython.org
Home | Jython
The Jython project provides implementations of Python in Java, providing to Python the benefits of running on the JVM and access to classes written in Java. The current release (a Jython 2.7.x) only supports Python 2 (sorry).
Java implementation of the Python interpreter
Jython Logo
Jython is an implementation of the Python programming language designed to run on the Java platform. It was known as JPython until 1999. Jython programs can import and use any Java class. โ€ฆ Wikipedia
Factsheet
Initial release January 17, 2001; 25 years ago (2001-01-17)
Stable release 2.7.4
/ 18 August 2024; 19 months ago (18 August 2024)
Written in Python and Java
Factsheet
Initial release January 17, 2001; 25 years ago (2001-01-17)
Stable release 2.7.4
/ 18 August 2024; 19 months ago (18 August 2024)
Written in Python and Java
๐ŸŒ
Readthedocs
jython.readthedocs.io โ€บ en โ€บ latest โ€บ JythonAndJavaIntegration
Chapter 10: Jython and Java Integration โ€” Definitive Guide to Jython latest documentation
As you can see from the code, the returning Jython types are going to be coerced into Java types, so we define our interface methods using the eventual Java types. The third piece of code in the example above plays the most important role in the game, this is the object factory that will coerce our Jython code into a resulting Java class.
๐ŸŒ
Jython
jython.org โ€บ jython-old-sites โ€บ archive โ€บ 22 โ€บ userguide.html
Jython User Guide
The following example of an interactive session with Jython shows how a user could create an instance of the Java random number class (found in java.util.Random) and then interact with that instance.
๐ŸŒ
Python Software Foundation
wiki.python.org โ€บ jython โ€บ LearningJython
Jython Course Outline - Python Wiki
And here is an example of the use of this custom container class: $ jython Jython 2.2.1rc1 on java1.4.2_10 Type "copyright", "credits" or "license" for more information.
๐ŸŒ
Processing
py.processing.org โ€บ tutorials โ€บ python-jython-java
Python, Jython and Java \ Tutorials
Python Mode for Processing extends the Processing Development Environment with the Python programming language.
๐ŸŒ
Jython
jython.org โ€บ jython-old-sites โ€บ archive โ€บ 21 โ€บ docs โ€บ usejava.html
Accessing Java from Jython
One of the goals of Jython is to make it as simple as possible to use existing Java libraries from Python. Example ยท The following example of an interactive session with Jython shows how a user could create an instance of the Java random number class (found in java.util.Random) and then interact ...
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ jython โ€บ jython_java_application.htm
Jython - Java Application
All objects known to the Jython runtime system are represented by an instance of the class PyObject or one of its subclasses. The PythonInterpreter class has some regularly used methods, which are explained in the table given below. The following code block is a Java program having an embedded Jython script hello.py.usingexecfile() method of the PythonInterpreter object.
๐ŸŒ
Medium
medium.com โ€บ @KosteRico โ€บ jython-run-python-code-inside-java-de4d12f227ae
The Beginnerโ€™s Guide To Jython: run Python code inside Java | by Konstantin Parakhin | Medium
November 30, 2021 - Also, we may use __tojava__() method. Letโ€™s create a Python list and try to cast it to Java List class: ... Here weโ€™ve played a bit with Jython, looked at some core features.
Find elsewhere
๐ŸŒ
SmartBear
smartbear.com โ€บ blog โ€บ embedding-jython-in-java-applications
Embedding Jython in Java Applications
December 31, 2013 - Jython is an implementation of the Python programming language in Java, running on the Java Virtual Machine (JVM), as opposed to the standard implementation of Python which is implemented in C (CPython). Python developers can use it to take advantage of the vast libraries available to the Java co...
๐ŸŒ
ImageJ
imagej.net โ€บ scripting โ€บ jython โ€บ examples
Jython Scripting Examples
The performance of low-level loops in jython are far from the performance offered by java. But writing a special-purpose java class for a minor piece of code is painful and requires specific java skills regarding code compilation and classpath management. The weaver removes all the pain. The weaver offers two ways to embed java code: the inline and the method. Here is an example using the inline approach, where the float[] pixels array of the current image is iterated to compute the mean intensity:
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ jython โ€บ index.htm
Jython Tutorial
This Jython Tutorial is based on the Latest 2.7.4 version. This tutorial will be helpful for Java programmers who want to utilize important features of Python i.e. Simple Syntax, Rich Data Types and Rapid Application Development in Java code.
๐ŸŒ
DZone
dzone.com โ€บ coding โ€บ java โ€บ embed jython to your java codebase
Embed Jython to Your Java Codebase
October 20, 2016 - package com.gkatzioura; import org.python.core.PyClass; import org.python.core.PyInteger; import org.python.core.PyObject; import org.python.core.PyObjectDerived; import org.python.util.PythonInterpreter; import java.io.InputStream; /** * Created by gkatzioura on 19/10/2016. */ public class JythonCaller { private PythonInterpreter pythonInterpreter; public JythonCaller() { pythonInterpreter = new PythonInterpreter(); } public void invokeScript(InputStream inputStream) { pythonInterpreter.execfile(inputStream); } }
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ jython โ€บ jython_quick_guide.htm
Jython - Quick Guide
In Jython, an event handler is assigned to the valueChanged property of the JList object. In the following example, a JList object and a label are added to a JFrame in the BorderLayout.
๐ŸŒ
Medium
medium.com โ€บ @rostyslav.ivankiv โ€บ the-power-of-jython-build-your-first-java-python-hybrid-application-in-5-minutes-f1e426d30166
The power of Jython: build your first Java-Python hybrid application in 5 minutes | by Rostyslav Ivankiv | Medium
April 8, 2023 - And finally we may invoke the Python function from Java to calculate the result and print it in Main.java. ... <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>jython-example</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.python</groupId> <artifactId>jython-slim</artifactId> <version>2.7.3</version> </dependency> </dependencies> </project>
๐ŸŒ
Python Software Foundation
wiki.python.org โ€บ jython โ€บ NewUsersGuide
NewUsersGuide - JythonWiki
The following example of an interactive session with Jython shows how a user could create an instance of the Java random number class (found in java.util.Random) and then interact with that instance.
๐ŸŒ
GitHub
github.com โ€บ cn28h โ€บ jython-example
GitHub - cn28h/jython-example: A simple example of how to call Python code from Java
A simple example of how to call Python code from Java ยท $ mvn package $ java -jar target/jython-example-1.0-SNAPSHOT-jar-with-dependencies.jar
Forked by 6 users
Languages ย  Java 88.9% | Python 11.1% | Java 88.9% | Python 11.1%
๐ŸŒ
Readthedocs
jython.readthedocs.io โ€บ en โ€บ latest โ€บ Scripting
Chapter 9: Scripting With Jython โ€” Definitive Guide to Jython latest documentation
So Iโ€™ve discussed a few of the modules that tend to come in handy when writing scripts for jython. Now Iโ€™ll put together a simple script to show off what can be done. Iโ€™ve chosen to write a script that will help handle the compilation of java files to .class files in a directory, and ...
๐ŸŒ
Datamelt
datamelt.org โ€บ data_dm โ€บ jython_manuals โ€บ j-jython1-ltr.pdf pdf
Intro to Jython, Part 1: Java programming made easier
Below are some example raise statements. ... Section 10. Jython procedural statements ... Summary of operator precedence on page 45 . They are similar to the expressions of ยท most languages, especially C/C++ and the Java language.
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ Jython
Jython - Wikipedia
December 11, 2025 - Except for some standard modules, Jython programs use Java classes instead of Python modules. Jython includes almost all of the modules in the standard Python programming language distribution, lacking only some of the modules implemented originally in C. For example, a user interface in Jython could be written with Swing, AWT or SWT.