Adding required import statements
The Java editor can help you adding required import statements for a selected type inside a compilation unit.
- Select a reference to a type in your Java code, and do one of the following:
- Select Source > Add Import from the pop-up menu in the editor
- Select Source > Add Import from the menu bar.
- Press Ctrl + Shift + M
- Either the editor can identify the type or you are prompted to choose the desired type from a list of possible types.
- The import statement is generated and inserted as specified by the import order preference.
![]()
![]()
Using the Java editor
Managing import statements
Organizing existing import statements
Setting the order of import statements