In , the IDE builds a JAR file from your project sources every time you
run the Build command. The JAR file is generated to the dist directory
of your project folder.
For that have a main class is specified, the IDE automatically copies
any JAR files on the project's classpath to the dist/lib folder
when you build the project. The IDE also adds each of the JAR files
to the Class-Path element in the application JAR's manifest.mf
file. This simplifies running the application outside the IDE. For more
information, see Preparing
a JAR for Deployment Outside the IDE
To change the JAR name and location:
In the Files window, go to the nbproject folder in your project
folder and open project.properties.
Enter the full path to the JAR file in the dist.jar property.
To specify which files are added to the JAR file:
Right-click the project node in the Projects window and choose Properties.
Select the Packaging node in the dialog's left pane.
Configure the filter and compression settings in the right pane.
To specify the manifest file for the JAR file:
In project.properties, type the name of the manifest file in the
manifest.file property. The file name must be specified relative
to the project's build.xml file.
If you are using the Java Application template, the IDE creates a manifest
file for you.
To disable generation of a JAR file for a project:
In the Files window, open your project folder and open build.xml.
Override the jar target to have no contents and no dependencies.
For example, add the following to build.xml:
<target name="jar" />
In , JAR file creation is controlled by your Ant script.