eclipse导入项目后出现问题:package后面报红线

Eclipse: The declared package does not match the expected package

分析原因:

存放.java源文件的根目录source folder设置不正确

Eclipse: The declared package does not match the expected package

解决方法:

右击项目 -> “build path” -> remove 掉当前的source folder -> 添加 src(com上一级文件名)作为source folder。

Eclipse: The declared package does not match the expected package

Eclipse: The declared package does not match the expected package

Eclipse: The declared package does not match the expected package

OK,解决!


相关文章: