Rohan
Rohan

Reputation: 703

Why is "Save as" option is missing in IntelliJ IDEA?

Why isnt there a simple save-as option in IntelliJ IDEA? Is there a way to easily save as a file?

Upvotes: 6

Views: 5264

Answers (4)

Oleg Poltoratskii
Oleg Poltoratskii

Reputation: 816

Short direct answer:

Press F5 and write new name of new class.

Not direct answer with question:

You should think carefully - why do you want to duplicate code?

Probably it's better to extract "future" common code to separated class and use it in your old and new classes.

Upvotes: 0

Urban Niklasson
Urban Niklasson

Reputation: 31

In my experience looking for alternate ways of performing simple tasks like Save as is both annoying and time-consuming, and Refactor | Copy is not a very intuitive alternative.

Upvotes: 3

CrazyCoder
CrazyCoder

Reputation: 402493

Save as is essentially the same as making a copy of the file under the different name. IntelliJ IDEA copy operation is provided via the refactoring, so you can use Refactor | Copy (F5) instead of Save as.

Upvotes: 2

Metaphox
Metaphox

Reputation: 2116

You may want to try Refactor -> Copy.... This creates a new .java file and rename the class name for you if the file is Java source code, otherwise simply duplicate the current file under a new name.

Upvotes: 1

Related Questions