当前位置: 移动技术网 > 科技>操作系统>windows > 如何处理Eclipse错误消息 The declared package does not match the expected package

如何处理Eclipse错误消息 The declared package does not match the expected package

2020年03月17日  | 移动技术网科技  | 我要评论

磨颧骨前后对比图,行尸走肉第八季第4集,深度水产

在使用eclipse时,有时需要从现有的文件夹开始工作

这时需要首先在eclipse中创建一个新的java project,然后file->import->file system,选中该文件的母文件夹即可导入

但是此时,可能会出现“ the declared package does not match the expected package"的问题,这时需要进行进一步的工作:

  1. 将代表package的文件夹的所有祖先文件夹"build path -> remove from build path"
  2. 将代表package的文件夹"build path -> use as source folder"
  3. 即使代表package的文件夹分别在不同的文件夹中也是一样,如package "p1" 可能同时出现在src文件夹和test文件夹中,而src文件夹和test文件夹有共同的父文件夹,这是分别按照1、2步进行操作即可

 

参考自 jerrywang_汪子熙 

如何处理eclipse错误消息 the declared package does not match the expected packaged

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网