jvmPath = jpype.getDefaultJVMPath()
# './jars/jpype_test_new.jar' java代码jar包文件路径
jpype.startJVM(jvmPath,"-ea", "-Djava.class.path=%s" % './jars/jpype_test_new.jar')
# jpype_test.Xcloudjdbc_new jpype_test:项目名 Xcloudjdbc_new:类名
Xcloudjdbc_new = jpype.JClass("jpype_test.Xcloudjdbc_new")
# 创建对象
xcloud = Xcloudjdbc_new()
# 调用方法
xcloud.func()
# 关闭虚拟机
jpype.shutdownJVM()
jpype:python调用java代码
最新推荐文章于 2024-09-13 17:31:46 发布