Reputation: 135
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
Upvotes: 4
Views: 3437
Reputation: 3390
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.
Upvotes: 2