Skip to content

Tag: package

Eclipse: The declared package does not match the expected package

I have a problem importing an external project. I go File -> Import… -> Existing Projects into Workspace, choose the folder where the project is located and everything is imported – but the package names of the project don’t seem to be what Eclipse expects. The package names all have a prefix: etc. But Eclipse expects etc. because the directory

Why is my Eclipse Java package being treated as a folder?

My Eclipse Java package is treated as a folder; can anyone suggest what’s wrong? Answer Worst case, you’ll have to delete the folder and recreate as a java package. Save the Java classes somewhere else in your Java project by refactoring Delete the folder and the underlying folder structure Create a Java package Move the Java classes back under the