java - Eclipse 错误:Path must include project and resource name

 亲亲宝贝的夏天狂想曲_540 发布于 2022-10-25 17:31

最近硬盘上同一位置的代码同时在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

3 个回答
  • maven的话,保留编写的文件就好,IDE生成的就不要

    2022-10-26 23:29 回答
  • 删除项目目录下的
    .settings/ 文件夹
    .classpath 文件
    .project 文件

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

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

    2022-10-26 23:29 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有