Eclipse 错误:Path must include project and resource name

最近硬盘上同一位置的代码同时在windows和linux的eclipse里导入运行了。

从linux回到windows系统,发现eclipse报错了。

图片描述

重新编译,update,clean都没法解决

StackOverflow上的答案是这样的:

This was caused by locally defined environment variable called $BROOT which was set in ~/.bashrc, and then picked up by the maven pom.xml. The environment variable put the output directory of the project outside the eclipse workspace, which is not how Eclipse likes to do things.

The solution was to unset the environment variable. This is the reason it works in Windows because Windows wouldn't know anything about ~/.bashrc.

但是不知道怎么unset the environment variable

回答:

最后发现原来是在Ubuntu下启动eclipse时,用的是windows下的文件路径,在项目目录生成了一个E:盘的路径。而且在windows下无法删除。回到Ubuntu下删除,就好了

回答:

删除项目目录下的
.settings/ 文件夹
.classpath 文件
.project 文件

然后重新将该maven项目导入到eclipse中

回答:

maven的话,保留编写的文件就好,IDE生成的就不要

以上是 Eclipse 错误:Path must include project and resource name 的全部内容, 来源链接: utcz.com/a/166316.html

回到顶部