python 调用java 如何调用

import jpype

import os

jarpath = os.path.join(os.path.abspath('.'), '/waimai_sign.jar')#第二个参数是jar包的路径

jpype.startJVM(jpype.getDefaultJVMPath(), "-ea", "-Djava.class.path=%s" %(jarpath))#启动jvm

JDClass = jpype.JClass("waimai_sign_algorithm")

ss = JDClass()#创建类的实例,可以调用类里边的方法

response=ss.get_para('/mtapi/v7/poi/channelpage','180')

print(response)

jpype.shutdownJVM()#最后关闭jvm

请问这里的jpype.JClass 调用的包名是什么?
报错如下

"D:\loading software\python3.8\python.exe" F:/shansong/test/test.py

Traceback (most recent call last):

File "F:/shansong/test/test.py", line 7, in <module>

JDClass = jpype.JClass("waimai_sign_algorithm")

File "D:\loading software\python3.8\lib\site-packages\jpype\_jclass.py", line 99, in __new__

return _jpype._getClass(jc)

TypeError: Class waimai_sign_algorithm is not found

Process finished with exit code 1
python 调用java 如何调用

以上是 python 调用java 如何调用 的全部内容, 来源链接: utcz.com/p/937975.html

回到顶部