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
I had the experience, that the build process is different, depending on the project type.
I suppose, you've created "Java Class Library" project.
So just create a "Java Application" project, then merge all classes to it.
Then, Netbeans will not override, but enhance the "manifest.mf"
into the JAR.
Of course, it's a stupid Netbeans bug. Of course it should be possible to add main classes afterwards.
EDIT: Please see my other answer. It's easier.
Maybe you created Java Project with Existing Sources instead of Java Application?
I had similar problem and creating new Java Application and then manually copying src files solved the problem - everything worked "out of the box".
If you are using the maven assembly plugin and want to build an executable jar with dependencies, you need to add this portion to the configuration of the maven-assembly-plugin section in your pom.xml:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<!-- ... -->
<archive>
<manifest>
<mainClass>your.app.SampleClass</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
Source: Maven Assembly Plugin Usage
Goto the Files view. Create a manifest.mf in the root directory.
/project_folder
build.xml
manifest.mf(edit here)
/dist
/src
/test
/build
Ok with neatbean you can do following steps below:
1. Right click name project choose item Set Configuration and Choose Customize
2. Choose Run and notice Main Class
3. Choose Browse and set class if you want to run. After you click ok.
4. Finish.