Using a java library from python

前端 未结 6 1365
日久生厌
日久生厌 2020-12-02 07:38

I have a python app and java app. The python app generates input for the java app and invokes it on the command line.

I\'m sure there must be a more elegant solution

6条回答
  •  粉色の甜心
    2020-12-02 08:23

    Wrap your Java-Code in a Container (Servlet / EJB).

    So you don´t loose time in the vm-startup and you go the way to more service-oriented.

    For the wraping you can use jython (only make sense if you are familiar with python)

    Choose a communication-protocoll in which python and java can use:

    • json (see www.json.org)
    • rmi (Python: JPype)
    • REST
    • SOAP (only for the brave)

    Choose something you or your partners are familliar with!

提交回复
热议问题