jar file created in netbeans not executing

佐手、 提交于 2019-12-10 15:15:15

问题


I have written some GUI program in netbeans which makes use of swing and it's working fine.I created jar file by right-clicking on project>clean and build and all the resources are included in it from project properties.The jar file in dist folder is executing through commandline using

java -jar mig_log.jar

but whenever I double click the jar file it says "Could not find the main class.Program will exit". I referred these links but nothing worked out : producing executable jar in netbeans

Could not find the main class


回答1:


In Netbeans, go to Properties of project, then in Run tab browse and select Main Class that has main() method which starts your GUI, and then clean and build to create jar file. Now double clik JAR file, and let me know result.



来源:https://stackoverflow.com/questions/14143015/jar-file-created-in-netbeans-not-executing

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