When downloading, you will see two primary options. Choosing the right one depends on your use case: Jython Standalone Format Executable JAR ( jython-installer-X.X.X.jar ) Single JAR ( jython-standalone-X.X.X.jar ) Best For Full local installation, developing scripts Embedding in Java apps, portable use Components Requires installation to a directory Contains everything in one file Setup Adds scripts like jython.exe or jython.sh Just add to your CLASSPATH How to Use the Standalone JAR
Once you have downloaded the standalone file, you can use it immediately without an installation wizard: download jython standalone
The most direct way to get the latest stable version (currently , released August 2024) is from the official project sites: When downloading, you will see two primary options
import org.python.util.PythonInterpreter; // ... PythonInterpreter interpreter = new PythonInterpreter(); interpreter.exec("print('Hello from Jython!')"); Use code with caution. Common Use Cases Common Use Cases :Open your terminal or command
:Open your terminal or command prompt and run: java -jar jython-standalone-2.7.4.jar Use code with caution. Execute a Script :To run a specific Python script: java -jar jython-standalone-2.7.4.jar your_script.py Use code with caution.
: You can download specific versions directly from the Maven Central Repository if you need to automate the download or require an older version. Direct Download (v2.7.4) : jython-standalone-2.7.4.jar. Installer vs. Standalone JAR