Removing a File or Folder

See Also

When you remove a file from your Java project, the file is no longer built with the project; however, the file still remains in the project directory structure on the hard disk. When you remove a folder, the folder and all of its files are removed from the project, but they are still left on the hard disk.

You can also choose to actually delete the file or folder from both the project and the hard disk.

Note   Removing or deleting a .java file does not automatically remove or delete the associated .class file (if it exists). However, you can display the .class file in Project Explorer and then manually remove or delete it.

To remove a file or folder from the project

  1. In Project Explorer, right-click the name of the file or folder to be removed.

  2. On the shortcut menu, click Remove From Project.

To delete a file or folder from the project and the hard disk

  1. In Project Explorer, select the name of the file or folder to be deleted.

  2. Press DELETE.

Note   If an item is deleted through the file system, it is automatically deleted from the project and removed from Project Explorer.

Project Explorer provides the option of displaying the items you have removed from your project. For more information, see Displaying All Files in the Project Directory Structure. For information about adding a removed file or folder back to the project, see Adding a File and Adding a Folder, respectively.