参考
打包jar文件参考:https://jingyan.baidu.com/article/597a064357b73a312b5243ae.html
https://blog.csdn.net/qq_38486203/article/details/90056749
1.安装包
pip install jpype1
2.Python代码
from jpype import * jvm_path = getDefaultJVMPath() # 直接获取环境变量的jvm startJVM(jvmpath, "-ea", "-Djava.class.path=.") # 默认当前路径的class TA = JPackage('test').TestApi # test包下面的TestApi类 jd = TA() # 实例化 jd.printData('1234') # 调用printData()方法,传入参数:1234 s = jd.getData('a') # 调用getData()方法,传入参数:a print(s) shutdownJVM(); # 关闭JVM