# Copying and moving Java elements

To move Java elements:

1. From a Java view, select the Java elements you want to move.
2. From the menu bar, select Refactor > Move or, from the view's pop-up menu, select Refactor > Move.
3. In the resulting dialog, select the new location for the element and press OK.
   Note: Moving static members (such as methods and types), classes or compilation units allows you to choose to also update references to these elements. Additional options may be available; for more on these options, see the documentation for the corresponding "Rename" refactoring.

You can also move Java elements by dragging them and dropping in the desired new location.

Note: Dragging and dropping compilation units and types allows you to update references to these elements. In the dialog that appears on dropping, press Yes if you want to update references, press Preview if you want to see the preview of the reference updates, press No if you want to move the elements without updating references or press Cancel if you want to cancel the move operation. Additional options may be available; for more on these options, see the documentation for the corresponding "Rename" refactoring.

To copy Java elements you need to copy them to the clipboard and paste them in the desired new location:

1. From a Java view, select the Java elements you want to copy to the clipboard and do one of the following:
   - Press Ctrl+C
   - From the menu bar, select Edit > Copy
   - From the view's pop-up menu, select Copy
2. Now, to paste the elements, select the desired destination and do one of the following:
   - Press Ctrl+V
   - From the menu bar, select Edit > Paste
   - From the view's pop-up menu, select Copy

You can also copy Java elements by dragging them and dropping in the desired new location. You will need to have Ctrl pressed while dragging to copy the elements.

Java projects

Creating Java elements
Moving folders, packages, and files
Copying and moving Java elements

Edit menu
Refactoring actions