[ Disclaimer: I am the primary maintainer of PJRmi ]
Similar to JPype, PJRmi is one of the libraries which provides support for calling into Python; there are others listed in the Other Work section of the README.are:
py4j allows Python to call into Java. It also supports Java calling back into Python so that Python clients can implement Java interfaces. It works by communicating over a socket.
jpy is another in-process implementation. One of its key features is support for fast pass-by-value operations with arrays by use of pointer hand-off.
jpype is another in-process implementation. Since it also uses internal C-based handoff it's highly performant.
PyJNIus is another implementation which accesses Java classes using JNI.
A simple example of calling into Java from Python, where the Java process is long-lived, would look like:
>>> import pjrmi
>>> c = pjrmi.connect_to_child_jvm()
>>> HashMap = c.javaclass.java.util.HashMap
>>> m = HashMap(dict((str(i), i+1) for i in range(5)))
>>> m.get("3")
4
More detailed examplesWhich one of use can be found in the notebook invarious versions of the git repositoryPython/Java bridges you like depends upon your use-case. It also supports tightOnes which use direct JNI for hand-off numpy integration, via the Hypercube package; again(like JPype) tend to be very fast but might limit you to a notebook gives examples of thissingle Java instance per invocation.