如下所示:fromjpypeimport*jvmPath=getDefaultJVMPath()jars=["./Firstmaven-1.0-SNAPSHOT-jar-with-dependencies.jar"]jv
如下所示:
from jpype import *
jvmPath = getDefaultJVMPath()
jars = ["./Firstmaven-1.0-SNAPSHOT-jar-with-dependencies.jar"]
jvm_cp = "-Djava.class.path={}".format(":".join(jars))
startJVM(jvmPath,jvm_cp)
sedisObj = JClass("LogBack")
so = sedisObj()
print so.get_v('name0')
print so
print so.get_int()
shutdownJVM()
以上这篇python调用java的jar包方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
python java jar包