One problem I've just discovered with the same error is that the maven build 2.7.0 does not include the lib folder. This is probably a build error for the release build. I had to move up the b2 build which does properly include the lib folder in the supplied jar.

Problem maven 2.7.0 jar:
<dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.0</version> </dependency>

Working maven 2.7.1b2 that includes the lib folder:
<dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.1b2</version> </dependency>

NOTE: If you download the jar directly from the Jython site it does correctly include the lib folder. It's just the maven repository version.

Answer from Tim Cederquist on Stack Overflow
🌐
Jar-Download
jar-download.com › home › org.python › jython › 2.5.0 › source code › pythoninterpreter.java
org.python.util.PythonInterpreter Maven / Gradle / Ivy
package org.python.util; import ... import org.python.core.__builtin__; /** * The PythonInterpreter class is a standard wrapper for a Jython interpreter for use embedding in a * Java application....
🌐
Jar-Download
jar-download.com › home › org.python › jython-standalone › 2.7.0 › source code › pythoninterpreter.java
src.org.python.util.PythonInterpreter Maven / Gradle / Ivy
Maven · Gradle · Ivy · SBT · package org.python.util; import java.io.Closeable; import java.io.Reader; import java.io.StringReader; import java.util.Properties; import org.python.antlr.base.mod; import org.python.core.CompileMode; import org.python.core.CompilerFlags; import org.python.core.imp; import org.python.core.Options; import org.python.core.ParserFacade; import org.python.core.Py; import org.python.core.PyCode; import org.python.core.PyException; import org.python.core.PyFile; import org.python.core.PyFileWriter; import org.python.core.PyModule; import org.python.core.PyObject; import org.python.core.PyString; import org.python.core.PyStringMap; import org.python.core.PySystemState; import org.python.core.__builtin__; import org.python.core.PyFileReader; /** * The PythonInterpreter class is a standard wrapper for a Jython interpreter for embedding in a * Java application.
🌐
Stack Overflow
stackoverflow.com › questions › 68250378 › problem-importing-jython-in-modular-project
java - Problem importing Jython in modular project - Stack Overflow
July 5, 2021 - In the maven pom.xml file I added the Jython dependency: <dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.2</version> <scope>compile</scope> </dependency> I observed that without using modules Jython works fine. Specifically, the following method works flawlessly in a basic project I created: import org.python.core.PyObject; import org.python.util.PythonInterpreter public void pyth() { try (PythonInterpreter pyInterp = new PythonInterpreter()) { pyInterp.exec("x = 10+10"); PyObject x = pyInterp.get("x"); System.out.println(x.asInt()); } }
🌐
Readthedocs
jython-devguide.readthedocs.io › en › latest › release_jy.html
23. How To Release Jython — Jython Developer's Guide
// Application importing the jython-slim JAR. plugins { id 'application' } repositories { mavenLocal() mavenCentral() } dependencies { implementation 'org.python:jython-slim:2.7.4' } application { mainClass = 'uk.co.farowl.jython.slimdemo.RegressionTest' } The following executes test.regrtest using the same local copy of the tests prepared for the stand-alone Jython. package uk.co.farowl.jython.slimdemo; import org.python.util.PythonInterpreter; public class RegressionTest { public static void main(String[] args) { try (PythonInterpreter interp = new PythonInterpreter()) { interp.exec("import sys, os"); interp.exec("sys.path[0] = os.sep.join(['.', 'TestLib'])"); interp.exec("sys.argv[1:] = ['-e']"); interp.exec("from test import regrtest as rt"); interp.exec("rt.main()"); } } } Tests have about the same success rate as for the stand-alone Jython JAR.
🌐
DZone
dzone.com › coding › java › using python libraries in java
Using Python Libraries in Java
May 16, 2025 - This is a Maven convention commonly used in Java projects to store non-Java resources like configuration files, properties, XML, JSON, or other static data needed at runtime. ... import org.python.util.PythonInterpreter; import java.io.FileReader; ...
🌐
Findjar
findjar.com › class › org › python › util › PythonInterpreter.html
org.python.util.PythonInterpreter - JAR Search - findJAR.com
This page shows details for the Java class PythonInterpreter contained in the package org.python.util. All JAR files containing the class org.python.util.PythonInterpreter file are listed
Find elsewhere
🌐
Maven Repository
mvnrepository.com › artifact › org.python
Maven Repository: org.python
It thus allows you to run Python on any Java platform. ... aar android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle groovy io ios javascript jvm kotlin library logging maven mobile module npm ...
🌐
Java Tips
javatips.net › api › org.python.util.pythoninterpreter
Java Examples for org.python.util.PythonInterpreter
public void run() { this.setName("fail"); try { ServerSocket ssocket = new ServerSocket(8999); ssocket.setSoTimeout(500); while (true) { try { /* * This python code is not working properly under Jython. My * hunch is that it would be better under the new Jython 2.5.1 * but that version is not easy to use under Maven, see: * * http://bugs.jython.org/issue1512 * http://bugs.jython.org/issue1513 * PythonInterpreter python = new PythonInterpreter(); python.execfile( // Load the python path parser script from the classpath Thread.currentThread().getContextClassLoader().getResourceAsStream( "rrdPath
🌐
Stack Overflow
stackoverflow.com › questions › 50835836 › intellij-python-interpretor
maven - Intellij - Python interpretor - Stack Overflow
June 13, 2018 - Added the interpreter at module level in project settings an it worked fine for me. Project Settings -> Modules -> Click + an added the python home directory.
🌐
Jython
jython.org
Home | Jython
import org.python.util.PythonInterpreter; public class JythonHelloWorld { public static void main(String[] args) { try(PythonInterpreter pyInterp = new PythonInterpreter()) { pyInterp.exec("print('Hello Python World!')"); } } } from java.lang import System # Java import print('Running on Java version: ' + System.getProperty('java.version')) print('Unix time from Java: ' + str(System.currentTimeMillis())) Ready to get started?
🌐
GitHub
github.com › oracle › graalpython › issues › 96
Expose the Python truffle interpreter in a Maven package · Issue #96 · oracle/graalpython
August 5, 2019 - I would be interested in using the Python interpreter developed here from a Java application, as a replacement for the Jython library that we currently use. However it does not seem that this use of the codebase is documented anywhere? As a user, I would find it useful to have a Maven package for this Python interpreter, which would depend on the appropriate Truffle packages.
Author   oracle
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360001555939-Using-jython-maven-dependency-as-Python-interpreter-for-IntelliJ-python-plugin
Using jython maven dependency as Python interpreter for IntelliJ python plugin – IDEs Support (IntelliJ Platform) | JetBrains
November 15, 2018 - <dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.1</version> </dependency> How can I use this jython as the interpreter for the python plugin? This is not a separate installation of jython, but rather just a dependency that gets only the jar file.
🌐
Maven Repository
mvnrepository.com › artifact › org.python › jython-standalone › 2.5.2
Maven Repository: org.python » jython-standalone » 2.5.2
June 26, 2011 - org.python · Description · Python · Language Runtime · TOML Language · Regular Expression Libraries · JVM Languages · Expression Languages · JavaScript Processors · Maven Plugins · Testing · Android Packages · Language Runtime · JVM Languages · Logging Frameworks · JSON Libraries · Java Specifications · Core Utilities ·
Published   Jun 26, 2011
Version   2.5.2
🌐
Stack Overflow
stackoverflow.com › questions › 62906137 › jython-running-a-python-script-within-java-set-the-pythonpath
Jython: Running a Python script within Java -- Set the PYTHONPATH? - Stack Overflow
July 15, 2020 - I am trying to run a python v3 script within Java using the org.python.* library (a.k.a jython) import org.python.util.PythonInterpreter; ... @Test public void test() throws Exception {
🌐
Grey Panther's Place
grey-panther.net › 2011 › 10 › using-jython-from-maven.html
Using Jython from Maven - Grey Panthers Savannah
October 13, 2011 - PythonInterpreter interp = new PythonInterpreter(); try { interp.exec("import re"); } catch (PyException ex) { ex.printStackTrace(); } The solution? Use the jython-standalone artifact which includes the standard libraries. An other advantage is that it has the latest release (2.5.2) while jython lags two minor revisions behind (2.5.0) in Maven Central. A possible downside is the larger size of the jar. org.python jython-standalone 2.5.2 ·
🌐
Maven Repository
mvnrepository.com › tags › python
Maven Repository: python
Maven Plugins · Testing · Android Packages · Language Runtime · JVM Languages · Logging Frameworks · JSON Libraries · Java Specifications · Core Utilities · Annotation Libraries · Mocking · Web Assets · HTTP Clients · Logging Bridges · Dependency Injection · XML Processing · Concurrency Libraries · Web Frameworks · Android Platform · Code Generators · View All · org.python » jython-standalone JYTHON ·
🌐
Coderanch
coderanch.com › t › 615730 › languages › python-dependencies-jython-maven
python dependencies for jython (maven?) (Jython/Python forum at Coderanch)
My plan is to use Jython to connect to my python scripts via PythonInterpreter.java. Including the jython jar is easy through the Maven dependency management system, but I am having difficulty figuring out how to enable Jython to recognize the Python tool as a dependency as well.
🌐
GitHub
github.com › certik › jython › blob › master › src › org › python › util › PythonInterpreter.java
jython/src/org/python/util/PythonInterpreter.java at master · certik/jython
import org.python.core.*; import java.util.*; · /** * The PythonInterpreter class is a standard wrapper for a Jython · * interpreter for use embedding in a Java application. * * @author Jim Hugunin · * @version 1.0, 02/23/97 · */ · public class PythonInterpreter { PyModule module; protected PySystemState systemState; PyObject locals; ·
Author   certik