JavaFX .exe file Failed due to exception in main class

纵饮孤独 提交于 2019-12-02 17:38:31

问题


I developed an JavaFX application and used the native packaging tool (incl. Inno Setup 5 and WiX) to create .exe files and installers. The program is a self-containing application, means it has its own JRE on board and some external .jars in a /lib folder. When I install and execute it it runs fine on my own computer (Windows 7) and some other machines but it seems not to run on Windows 10 and Windows Server 2008 R2. Also some Windows 7 machines cannot execute it. The error message after clicking the launch icon is: "Failed due to exception in main class". It does not say more. But when I execute the jar file by double-clicking or via the command prompt, it starts without any error dumps in the command line, all works fine.

Any idea what the error is? I suspect the class path but I dont know for sure.

Thank you!

Best regards,

Alex


回答1:


Found out myself: the issue were VM parameters I added in the build.xml in the fx:platform / fx:jvmarg section. These params were put into the package.cfg file which is called from the .exe file to initialize the VM.

Obviously some of the operating systems I used to install the tool did not have the correct Java setup (it is not about classpath settings, I checked that beforehand too) so the VM crashed before being able to instantiate the tool and therefore my custom error logger.

After removing the error causing VM params (parameters for debugging, security manager and the location of the policy file) it worked on all Windows platforms (7/8/10) as it should.



来源:https://stackoverflow.com/questions/33212291/javafx-exe-file-failed-due-to-exception-in-main-class

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