如何使用Windows的javafx本机包调试问题? [英] How to debug problems with the javafx native bundle for Windows?

查看:558
本文介绍了如何使用Windows的javafx本机包调试问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将JavaFX / DukeScript应用程序打包到本机包中。
对于使用Inno Setup实现的Windows,这就是javafxpackager使用的内容。
我找不到很多关于它的文档,所以我将创建一个问题并提供我在下面找到的答案。

I'm trying to package a JavaFX/DukeScript application into native bundles. For Windows that's achieved with Inno Setup, that's what the javafxpackager uses. I can't find much documentation about it, so I'll create a question and provide the answers I find below.

相关问题: 1 2 3 4

推荐答案

所以我使用e(fx)clipse创建了一个build.xml Ant脚本(参见示例这里)。
我一直关注这篇优秀的博文
现在,捆绑任务工作并生成了一个安装程序和可执行应用程序。
我一直无法运行应用程序而无法看到堆栈跟踪。
所以这里是从命令行运行可执行文件时如何显示带有堆栈跟踪的窗口:

So I've created a build.xml Ant script using e(fx)clipse (see example here). I've been following this excellent blog post. Now, the bundle task worked and produced an installer and executable app. I've been having trouble running the app and couldn't see a stack trace. So here's how to display a window with the stack trace when running the executable from the command line:

 goGPS_FX.exe /Debug

这会弹出一个带有堆栈跟踪的弹出窗口。就我而言,缺少jar依赖。所以只是为了测试,我在 deploy \bundles\goGPS_FX \app \ libs 下手动添加了jar。

That brings up a popup, with the stack trace. In my case, a jar dependency was missing. So just for testing, I manually added that jar under deploy\bundles\goGPS_FX\app\libs.

为了让JavaFX启动程序包含这个新jar,我需要修改文件 app \ package.cfg
据我所知,这是特定的JavaFX,Inno Setup不需要它。
此外,我找不到有关此文件的更多信息。
无论如何,我们可以更新一个名为 app.classpath 的属性。
其他相关属性是 app.mainclass 。这里的mainclass没有用标准的点分表示法指定,而是作为路径指定:

For the JavaFX launcher to include this new jar, I need to modify the file app\package.cfg. As far as I understand, that's JavaFX specific, it's not needed by Inno Setup. Also, I couldn't find much information about this file. Anyway, there's a property called app.classpath we can update. The other relevant property is app.mainclass. Here the mainclass is not specified with the standard dotted notation, but rather as a path:

app.mainclass=org/gogpsproject/GoGPS_Fx

最后,其他属性可能可用。我找到的是:

Finally, other properties might be available. One I've found was:

jvmarg.1=-Djavafx.verbose=true

如果需要,这是一种将参数传递给jvm的方法。

So that's a way to pass arguments to the jvm, should you need to.

这篇关于如何使用Windows的javafx本机包调试问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆