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
If you don't want to go the write your own JNI/C route.
The other option is to use jpype which for me is always what I use to access Oracle databases becuase installing the oracle c drivers on a PC is a pita. You can do stuff like (from docs):
from jpype import *
startJVM("d:/tools/j2sdk/jre/bin/client/jvm.dll", "-ea") # or path to your jvm
java.lang.System.out.println("hello world")
shutdownJVM()
It hasn't been updated in a while and there isn't much in the way of documentation but it does work reasonably well.