This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes How to generate jar using NetBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to generate jar using NetBeans" Watch "How to generate jar using NetBeans" New topic
Author

How to generate jar using NetBeans

Enrique Nivasch
Greenhorn

Joined: Aug 10, 2008
Posts: 2
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

Enrique,
Welcome to JavaRanch!

We have a forum dedicated to IDEs. I'll move this for you.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

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.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
 
Consider Paul's rocket mass heater.
 
subject: How to generate jar using NetBeans
 
Similar Threads
When I Run Main Project in NetBeans (F6) It always runs a project that isn't even open
Default netbeans servlet with JSP file
Application not running from jar
Run JAR file in Applet
Is this an applet?