javapythonjythonjpypepy4j

Different / better approaches for calling python function from Java


I am quite new to python and am trying to call python's function from java.

My primary requirements are these:

There are several options that I found online. Few are:

It seems that Jython PythonInterpreter is the best choice if I have understood all above approaches correctly. Have I made mistakes while grasping them? Also is there any other better option?


Solution

  • There is no current answer to this problem. Using CPython relies on the execution of Python bytecodes, which in turn requires that the Python interpreter be embedded in the execution environment. Since no Java runtime comes with an embedded Python interpreter, it really does look as though Jython is the best answer.

    Sometimes the answer you want just isn't available!