Building a Java Project

See Also 

When you build a project, the IDE calls the corresponding target in the project's Ant build script. The IDE compiles the source files and generates the packaged build output, such as a JAR file or WAR file. You can build the main project and all of its required projects, or build any project individually.

You do not need to build the project or compile individual classes to run the project in the IDE. By default, the IDE automatically compiles classes when you save them. These incrementally compiled files are stored in a cache in your user directory and are copied to your project's build folder when you run or debug your project. This incremental compilation can save you a lot of time when you are editing and testing your project.

However, you need to build the project to generate distributable files for the project, such as JAR files.

By default, the Build Project command is not enabled since most of that command's functions are handled by the incremental compilation. However, you can use the Clean and Build command to create a fresh build. When you clean and build a project, all previous build outputs are deleted and new versions of the build outputs are created.

To build the main project and its required projects:

To build an individual project and its required projects:

To stop building a project:

To turn off incremental compilation for a project:

  1. Right-click the project's node and choose Properties.
  2. In the Project Properties dialog box, select the Compiling node and clear the Compile On Save checkbox.
See also
Building Tasks: Quick Reference
Compiling a Single File
Building a JAR File
Managing the Classpath
Setting the Main Class and Runtime Arguments

Legal Notices