This compilation unit is not on the build path of a Java project 解决办法​

把项目导入STS(基于Eclipse)时,项目出现问题,

代码提示出不来,而且所有的类用Ctrl+click的方法也无跳转。

有提示如图错误


This compilation unit is not on the build path SVN


搜索发现,大致是因为项目文件缺失。

解决办法:找到项目根目录下的.project文件,修改,加入jdt支持,我的项目修改后如下所示↓

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>framework</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2021-05-08
  • 2021-04-01
  • 2021-10-04
  • 2021-04-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-11
  • 2022-12-23
  • 2021-09-13
  • 2021-06-12
相关资源
相似解决方案