Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to generate jar using NetBeans

 
Enrique Nivasch
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using NetBeans 6.1 to develop my software on a Vista based machine. My application is currently made up of two classes that live as two separate source files. When I click on the Run Main Project button on the IDE everything works fine. If I click on the Build Main Project button and the double click on the generated .jar file that sits in the dist folder I get a �Could not find the main class. Program will exit.� Message. How should I generate the jar file so it will run?


Thanks,

Enrique
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enrique,
Welcome to JavaRanch!

We have a forum dedicated to IDEs. I'll move this for you.
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's because there's no Main-Class field in your MANIFEST.MF. In order for NetBeans to add the Main-Class field in the MANIFEST.MF, you need to set the main class in your NetBeans project.
1. Right click on the project->Properties->Run
2. Set the main class.

Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic