wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 9 people, some anonymous, worked to edit and improve it over time.
This article has been viewed 131,185 times.
If you've ever tried to alter a variable's name manually, you'll know that it's a tedious process. In order for the program to compile, all occurrences of the variable must be found and changed to the new name. However, Eclipse makes this task extremely easy by providing a re-factoring tool that automatically finds and updates variable names. The build used here is Eclipse Ganymede 3.4.0.
Navigate to Highlight and right click on the variableyou want to rename. Refactorand select Rename....
Type in your new variable nameand press Enter.Advertisement
Verify that occurrences of the variable are updating as you type.
Check through the source code to ensure that no errors have arisen.Advertisement
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.Submit
- The hotkey for Rename is
Alt+ ⇧ Shift+ Rand is much faster than navigating through the menu.
- If you are on a mac, the hotkey is
Alt+ ⌘ Cmd+ R.
Submit a Tip
All tip submissions are carefully reviewed before being published
Thanks for submitting a tip for review!
- If there are any syntax errors near occurrences of your variable, those occurrences may not re-factor correctly since Eclipse will not know how to handle the errors. Always check problematic areas after refactoring.
About This Article
In other languages
Thanks to all authors for creating a page that has been read 131,185 times.