In
, the IDE builds a JAR file from your project sources every time you
run the Build command or the Clean and Build command. The JAR file is
generated to the dist directory of your project folder.
The Build command is disabled when the Compile on Save feature
is enabled for a project. When you save a file, the file is compiled,
but the JAR file is not repackaged with the new version of the
class file. If you want to be able to rebuild the JAR file without
doing a full clean and build of the project,
disable Compile on Save
for the project and use the Build command.
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 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 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.