There's another sourceforge project called pyro4. It can handle python modules like: numpy, sklearn... And maybe it's even better because it is currently developed. (last jepp version was released in 2010)

Answer from Balazs Varhegyi on Stack Overflow
🌐
GitHub
github.com › ninia › jep
GitHub - ninia/jep: Embed Python in Java · GitHub
Jep embeds CPython in Java through JNI. ... Using the native Python interpreter may be much faster than alternatives.
Starred by 1.5K users
Forked by 166 users
Languages   C 52.1% | Java 30.2% | Python 17.7%
🌐
PyPI
pypi.org › project › jep
jep · PyPI
Both Java and Python are cross platform, enabling deployment to different operating systems. Simply run pip install jep or download the source and run pip install .. Building and installing require the JDK and Python, to be installed beforehand.
      » pip install jep
    
Published   Nov 04, 2025
Version   4.3.1
Discussions

java - How to use python modules in jepp? - Stack Overflow
If I start 'jep' in command line, I get: 'Caused by: java.lang.ClassNotFoundException: jep.Run'. I followed the instructions from here:project_site. I installed jepp with 'sudo pip install jep' and set the two environment variable: 'LD_PRELOAD /usr/lib/libpython2.7.so' 'LD_LIBRARY_PATH /usr/local/lib/python2... More on stackoverflow.com
🌐 stackoverflow.com
Java and Python Integration using Jep - Stack Overflow
Also, this is not a Java Question. You already have a Python-String - so your question is "How to create klearn.ensemble.forest.RandomForestClassifier Object from string?" ... When Jep converts a Python object into a Java object if it does not recognize the Python type it will return the String ... More on stackoverflow.com
🌐 stackoverflow.com
Best way to combine Python and Java?
I've used JPype for a while. It also starts a JVM from python. Once set up, interoperating with Java is transparent. You can start the JVM in such a way that it can be debugged directly using remote debugging tools. More on reddit.com
🌐 r/java
82
60
October 29, 2022
python - Using Jep to modify java object - Stack Overflow
I've read a lot of documentation and questions here on Stack Overflow, but I'm still struggling to accomplish the task. I have a java object (JobInitDTO) that I created. I want to be able to run an More on stackoverflow.com
🌐 stackoverflow.com
🌐
JEP
ninia.github.io › jep
Jep - Java Embedded Python | JEP
Jep embeds CPython in Java through JNI. ... Using the native Python interpreter may be much faster than alternatives.
🌐
Tech
galina.tech.blog › 2022 › 07 › 11 › how-to-execute-python-modules-from-java
How To Execute Python Modules From Java. – A technical blog about Data Science
July 15, 2022 - Jep uses JNI and the CPython API to start up the Python interpreter inside the JVM. When you create an Interpreter instance in Java, a Python interpreter will be created for that Java Interpreter instance and will remain in memory until the ...
🌐
GitHub
github.com › ninia › jep › wiki › Getting-Started
Getting Started · ninia/jep Wiki · GitHub
August 30, 2019 - The shared library (jep.so or jep.dll) ... LD_LIBRARY_PATH) The jep python files (console.py, java_import_hook.py, version.py, etc) are accessible by Python (typically by placing them in the site-packages/jep directory)....
Author   ninia
🌐
Ninia
ninia.github.io › jep › javadoc › 3.7 › jep › Jep.html
Jep
Embeds CPython in Java. Each Jep instance can be considered a Python sub-intepreter, mostly sandboxed from other Jep instances.
Find elsewhere
🌐
GitHub
github.com › ninia › jep › wiki › How-Jep-Works
How Jep Works
August 30, 2019 - Jep uses JNI and the CPython API to start up the Python interpreter inside the JVM. When you create an Interpreter instance in Java, either a SubInterpreter or SharedInterpreter, a Python interpreter will be created for that Java Interpreter ...
Author   ninia
🌐
The SW Developer
theswdeveloper.com › post › java-python-jep
How to execute Python code in Java - The SW Developer
September 10, 2021 - In this tutorial we will show you how to integrate Java and Python code in an almost seamless manner with just a few easy steps.What is jep?Jep is an open source library which gives you the ability to execute Python code in Java and vice versa.Let's ...
🌐
Medium
medium.com › geekculture › how-to-execute-python-modules-from-java-2384041a3d6d
How To Execute Python Modules From Java | by Galina Blokh | Geek Culture | Medium
July 14, 2022 - Jep uses JNI and the CPython API to start up the Python interpreter inside the JVM. When you create an Interpreter instance in Java, a Python interpreter will be created for that Java Interpreter instance and will remain in memory until the ...
🌐
Snyk
snyk.io › advisor › python packages › jep
jep - Python Package Health Analysis | Snyk
February 14, 2021 - Jep embeds CPython in Java. Visit Snyk Advisor to see a full health score report for jep, including popularity, security, maintenance & community analysis. The python package jep receives a total of 19,244 weekly downloads. As such, jep popularity was classified as a popular.
🌐
GitHub
github.com › karpierz › jtypes.jep
GitHub - karpierz/jtypes.jep: Java Embedded Python (ctypes/cffi-based Jep). · GitHub
Java Embedded Python. ... PyPI record. jtypes.jep is a lightweight Python package, based on the ctypes or cffi library.
Author   karpierz
🌐
GitHub
github.com › ninia › jep › releases
Releases · ninia/jep
This patch fixes a regression introduced in Jep 4.3.0 with accessing java sub-packages from Python.
Author   ninia
🌐
Reddit
reddit.com › r/java › best way to combine python and java?
r/java on Reddit: Best way to combine Python and Java?
October 29, 2022 -

My project uses some packages that are available only in Python and heavily rely on C libraries. The project also greatly benefits from Java libraries and the JVM. What's the optimal way to call Python functions from Java?

I tried:

  1. Small web-services: overhead to serialize data, start and stop the services. Also debugging is harder and implementing each new function is now double the effort.

  2. Jpy: a library that runs an interpreter in the JVM. Spare the service start/stop, but: isn't really feasible for more than a single-liner, data translation between Java and Python is cumbersome, and I also encountered runtime segmentation fault errors.

Any other options?

The project is in the machine-learning domain, so involves exchanging large numeric arrays and text. In some cases the execution switches back and forth between the platforms.

🌐
Google Groups
groups.google.com › g › jep-project › c › r6Fo91Dio5I
Access a Java object at runtime in Jep-embedded Python
March 15, 2017 - That doesn't work but a similar statement of "from java.util import ArrayList" does work. You can notice the same behavior with other python packages, for example "import numpy.ndarray" fails but "from numpy import ndarray" succeeds. You can play with these imports with the jep command line script, though it will use the default ClassEnquirer (though that will include classes on the classpath).
🌐
Stack Overflow
stackoverflow.com › questions › 76507404 › using-jep-to-modify-java-object
python - Using Jep to modify java object - Stack Overflow
Eventually the object that will be returned from the Python function should be the same Java object- after the required modifications. ... @PostConstruct public void init() { String pythonFolder = System.getenv("DYLD_LIBRARY_PATH"); String jepPath = pythonFolder + "/libjep.jnilib"; if (!Files.exists(Path.of(jepPath))){ jepPath = pythonFolder + "/libjep.so"; } MainInterpreter.setJepLibraryPath(jepPath); // set path for python docs with python script to run jep.JepConfig jepConf = new JepConfig(); jepConf.addIncludePaths(System.getProperty("user.dir")+"/src/main/Python/"); jepConf.addIncludePath