When you rename a file or folder in your Java project, the file or folder on the hard disk is also renamed.
Important When renaming an item in your project, you must be careful to manually change all references to the old name. For example, Java requires a public class to have the same name as its source file. Therefore, if you rename a .java file, you must also rename the associated public class, and vice versa.
Note that if you rename a folder, you must change the package statement of each .java file in the folder. If a file's package statement does not map to the folder it resides in, the output directory structure will not match the project directory structure when you build the project.
To rename a file or folder in the project
Note If a file or folder is renamed through the file system, it is automatically renamed in Project Explorer. However, you must still change all references to the old name.