Rename Java Package in Eclipse

Today, I attempted to change a java package name. I did a right click at the package name and there’s no “Rename.”

What I did is creating a new package, say package.my.new. Then I go to package.my, right click > refactor> move and select package.my.new.

I then edited web.xml file, do a search replace from package.my to package.my.new and it works.

However, later I found that there’s a function “rename” under refactor. but I have not tried it. I will check it out next time.