why doesn't my jar file run outside netbeans?

点点圈 提交于 2019-12-01 14:49:58

Double-clicking the jar starts it, but unless you have a GUI application that opens a new window (in a different thread), it most likely finishes and closes before you can see anything.

In these cases you normally run the jar from the console (java -jar ..) to see if there are any exceptions/errors.

Starting an application from the command line would let you debug the problem as Bozho said. But you need to check if you have all the files in dist folder that you need to run your program. For example if you are using a database file to get the data, you need to place this file in the dist folder after program is built. I think the jar file is using a relative path when looking for files.

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