我已经使用eclipse-pydev创建了一个python项目。我正在使用Py4j从此python项目中调用Java应用程序。我已经将Java项目转换为可执行jar,并将其包含在Python项目中。
从eclipse运行代码时,代码工作正常。但是在使用pyinstaller将python项目转换为exe之后,会获得“找不到py4j jar错误”。
找到以下来自规范文件的数据。我如何将jar文件捆绑到安装程序中,以便调用JVM并访问类文件
C:\ temp \ projectname \ jar包含Java应用程序的可执行jar,其中包含py4j.jar。
Am使用python 3.6.4版本
coll = COLLECT(exe,
Tree('C:\\temp\\Projectname\\src'),
Tree('C:\\temp\\Projectname\\jar'),
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='main')