Eclipse: The declared package does not match the expected package

后端 未结 13 603
挽巷
挽巷 2020-12-25 09:03

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

13条回答
  •  醉酒成梦
    2020-12-25 09:41

    The build path should contain the path 'till before' that of the package name.

    For eg, if the folder structure is: src/main/java/com/example/dao If the class containing the import statement'package com.example.dao' complains of the incorrect package error, then, the build path should include:src/main/java This should solve the issue.

提交回复
热议问题