# Renaming a type

You can rename a type by modifying its declaration in the compilation unit in which it is declared. However, if you also want to update all references to it, do one of the following:

1. In a Java view presenting types (e.g. the Outline view, the Type Hierarchy views, etc.) select a type.
2. From the type's pop-up menu, select Refactor > Rename or use the Refactor > Rename action from the global menu bar.

or

1. In a Java editor, select a reference to the type.
2. From the editor's pop-up menu, select Refactor > Rename or use the Refactor > Rename action from the global menu bar.

Java projects

Creating a new Java class
Creating a new Java enum
Creating a new Java annotation
Creating a nested interface
Creating a top-level interface
Creating a top-level class
Creating a nested class
Creating a class in an existing compilation unit

Package Explorer
Refactoring actions
Refactoring dialogs
Java preferences