I have a number of Java files in Eclipse that currently have the wrong package at the top of them. They are in the correct directory, however. I would like to fix all of the errors at once (read: not manually).
I have tried the following:
-
If I go to the Problems view and try to Quick Fix, I can only do one
at a time. If I select some subset and try to quick fix (all with the
“The declared package” error), it states that they have nothing in
common. -
I have also tried to use Source -> Clean Up but it doesn’t fix my
errors either. -
My last hope is Search and Replace, but I would really like something
a bit more automatic.
It looks like there is an answer here:
Eclipse – How to "Change package declaration to …." across an entire project
And to quote from the answer:
“Unfortunately there is no option to fix the issue across multiple units at one go; you will have to apply the quick fix for every problem.”