Dave's Brain

Browse - Programming Tips - How do I rename a Java source file?

Date: 2010jun3
Level: beginner
Environment: Eclipse

Q.  How do I rename a Java source file?

A.  You are probably renaming the class inside the file too.
Eclipse has a way to rename the file and the class in one step.

In Package Explorer: Right click on your file. Select Refactor > Rename...
If the Package View is not present you can switch to it my doing:
Window > Show View > Package Explorer
from the main menu.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.