The declared package does not match the expected package
Eclipse uses import to import the source code into the project or SVN check-out to import the source code into the project. The console is prone to a large number of errors.
But at the same time, it can be compiled successfully by directly using ant script.
Don't worry at this time. You can see the opening error at the beginning of many classes: there is an error in package, and the prompt is:
The declared package does not match the expected package
The reason for the error is:
The definition of package in eclipse is generally generated through the package name, rather than through the hierarchy of files. When eclipse uses import to import the source code, it imports the file structure instead of the package form, so an error is reported.
resolvent:
Click > Properties > java build path > source > Add Folder > select Src / XXXX
Then recompile it.