How to debug problems with the javafx native bundle for Windows?

ぃ、小莉子 提交于 2019-12-24 02:39:16

问题


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.

Related questions: 1, 2, 3, 4


回答1:


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

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.

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

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



来源:https://stackoverflow.com/questions/30835516/how-to-debug-problems-with-the-javafx-native-bundle-for-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!