I\'m using NetBeans 6.5 and for some reason it won\'t produce executable jar \"out of the box\".
I set my project to be the main project, defined main class in the p
In 7.3 just enable Properties/Build/Package/Copy Dependent Libraries and main class (depending on selected target) will be added to manifest when building.
I just had the same problem in NetBeans 7.2.1 with a Maven Java Application project. Modify the pom.xml file to include the maven assembly plugin with one tweak to myrho's answer (needs to reference the predefined descriptor "jar-with-dependencies"):
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>your.app.MainClass</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
An alternate method is to build a Java Application project in NetBeans that doesn't use Maven. Select File -> Project Properties -> Build -> Packaging and check the "Copy Dependent Libraries" checkbox.
Try this:
Right click your project on the "Projects" panel, select "Properties"
Click on "Run" in the new window.
Edit the "Main Class:" field (click on Browse).
This way you will select the main class which is the entry point to your application and the Manifest will be created correctly.
To manually force package creation with NetBeans IDE 8.0.2 ...
The output window will then show (on Mac) ...
Building jar: /Users/<username>/NetBeansProjects/<project>/target/<project>-1.0-SNAPSHOT.jar
If you clean and build your project it should create the jar in the "dist" directory.
It should create the manifest.mf at the top level of your project directory.
Strange indeed, it should do it out of the box including the classpath.
Did you upgrade from a previous version? When upgrading, NB will upgrade the project files but sometimes this migration is not done well and this kind of scenario's pop up. Just close the project, rename the nbproject dir to nbproject_old and do new project -> Java project with existing sources. Set the main class again and add dependencies and try again.