Is there any way I can find wrong package declaration in my projects files

I know that if a file contains wrong package declaration, a warning or an error flag in the editor depending on the IDE setting. But there's lots of files in my project and it's impossible for me to open each file and check it. So I wonder if there's a way out. Thanks.