问题描述
我有一个程序,我使用 Eclipse IDE 将它编译成一个可运行的 jar,并使用 jpackage 转换为一个 .exe 文件。
但是,生成的文件不会成功运行。它似乎执行了代码的第一行(它创建了一个用于日志记录的 .txt 文件),然后抛出错误“无法启动 JVM”。
我已经尝试查看程序的清单文件并确保 -main-class 变量在我的 jpackage 命令中是正确的,但我看不出问题出在哪里。
这是我的 jpackage 命令:
class A:
def __init__(self,param):
self.param = param
curframe = inspect.currentframe().f_back
nodes = ast.parse(inspect.getsource(curframe))
for node in nodes.body:
try:
if node.value.func.id == self.__class__.__name__:
print(ast.dump(node))
except Exception:
pass
a = A('test')
b = 'another assign'
c = A('another test')
>>> Assign(targets=[Name(id='a',ctx=Store())],value=Call(func=Name(id='A',ctx=Load()),>>> args=[Constant(value='test',kind=None)],keywords=[]),type_comment=None)
>>> Assign(targets=[Name(id='c',>>> args=[Constant(value='another test',type_comment=None)
>>> Assign(targets=[Name(id='a',type_comment=None)
有谁知道是什么导致了这个错误?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)