Basic IDE Tasks: Quick Reference

This topic describes common tasks you can perform in the NetBeans IDE after you have created a project. For more detailed information on these tasks, click the links provided or browse the rest of the IDE's help.

To perform this task Follow these steps
Create a new file.
  1. Choose File > New File.
  2. In the wizard, select a file type from one of the categories and complete the wizard.
Build a project.
  1. Select the node of the project you want to build.
  2. Choose Build > Build Main Project (F11) or right-click any project in the Projects window and choose Build Project.
Stop building a project.
  • Choose Build > Stop Build/Run from the main menu.
Compile a single file.
  1. Select the node of the file you want to build.
  2. Choose Build > Compile File (F9).
Add a JAR file to a project's classpath.
  1. Open the Project Properties dialog box by right-clicking the project node and choosing Properties from the Project window.
  2. Select the Libraries node in the Categories pane. Then click the Compile tab.
  3. Click Add JAR and select the JAR file in the file chooser.
Add an IDE project to a project's classpath.
  1. Open the Project Properties dialog box by right-clicking the project node and choosing Properties from the Project window.
  2. Select the Libraries node in the Categories pane. Then click the Compile tab.
  3. Click Add Project and select the project directory for the project you want to add.
Clean a project (delete compiled classes and other artifacts of the built project).
  • In the Projects window, right-click the project node and choose Clean Project.
Clean and build the main project.
  1. Select the node of the project you want to clean and build.
  2. Choose Build > Clean and Build Main Project (Shift-F11).
View files created by the build.
  1. Open the Files window (Windows > Files) and expand the project folder node.
  2. Expand the build folder to view compiled classes.
  3. Expand the dist folder to view Javadoc files and built libraries, such as JAR files.
Correct compilation errors.
  • In the Output window, double-click any Java syntax error to jump to the location in the source code where the error occurred.
Set the project main class
  1. Right-click the project node in the Projects window and choose Properties.
  2. Select the Run node in the Categories pane.
  3. Type the fully qualified name of the class in the Main Class field.
Set the runtime arguments (arguments to the program's main method).
  1. Right-click the project node in the Projects window and choose Properties.
  2. Select the Run node in the Categories pane.
  3. Enter the arguments in the Arguments field.
Set the runtime classpath.
  1. Right-click the project node in the Projects window and choose Properties.
  2. Select the Libraries node in the Categories pane.
  3. Click Add Project, Add Library, or Add JAR/Folder.
Set JVM arguments.
  1. Right-click the project node in the Projects window and choose Properties.
  2. Select the Run node in the Categories pane.
  3. Type a space-separated list of arguments in the VM Options field.
Set the working directory for execution.
  1. Right-click the project node in the Projects window and choose Properties.
  2. Select the Run node in the Categories pane.
  3. Type the full path to the working directory in the Working Directory field.
Run a project.
  • Choose Run > Run Main Project (F6) or right-click any project in the Projects window and choose Run Project.

Run a single file.

  1. Select one or more files in the Projects window, Files window, or Source Editor.
  2. Choose Run > Run File > Run Class from the main menu.

Legal Notices