最近硬盘上同一位置的代码同时在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
。
Finally, I found out that when starting eclipse under Ubuntu, the file path under windows was used, and a path to the E: drive was generated in the project directory. And it cannot be deleted under Windows. Go back to Ubuntu and delete it, it will be fine
Delete the
in the project directory.settings/ folder
.classpath file
.project file
Then re-import the maven project into eclipse
If you use maven, just keep the files you wrote, but not the ones generated by the IDE