How to call java objects and functions from CPython?

后端 未结 6 726
栀梦
栀梦 2020-12-13 22:05

I have a python program, which runs on the CPython implementation, and inside it I must call a function defined in a java program. How can I do this?

It would be nic

6条回答
  •  死守一世寂寞
    2020-12-13 22:30

    I don't know for Python, but last time I had to call java from C application (NT service) I had to load jvm.dll. Take a look at JNI documentation.

    Also, you call always call

    os.system("java com.myapp.MyClass") 
    

    if you are not concerned about performance.

提交回复
热议问题