this compilation unit is not on the build path of a Java project
程序员文章站
2022-04-28 09:23:29
...
从SVN上面检出了一个项目,在写代码的时候使用自动提示就报“this compilation unit is not on the build path of a Java project”错误,如图。
原因是检出的项目缺失了Java编译器。
解决方案如下:
- 关闭eclipse
- 找到项目文件夹内的.project文件
- 在文件内增加Java编译器相关内容:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>检出的项目名称</name>
<comment></comment>
<projects>
</projects>
<!-- 检查有没有javabuilder,没有的话添加-->
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<!-- 检查有没有javanature,没有的话添加-->
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures>
</projectDescription>
4.重开IDE项目即可重新编译为正常项目
上一篇: Java集合中的HashMap类
下一篇: 创建私有CA并签发证书
推荐阅读
-
【eclipse】eclipse报错:the resource is not on the build path of a java project
-
报错:this compilation unit is not on the build path of a Java project
-
web deployment assembly 和Java build path-source
-
The project was not built since its build path is incomplete. Cannot find the class file for java.l
-
Eclipse报错:this compilation unit is not on the build path of a java project
-
Eclipse中This compilation unit is not on the build path解决办法
-
this compilation unit is not on the build path of a Java project
-
A cycle was detected in the build path of project
-
The project was not built since its build path is incomplete. Cannot find the class file for javax.e
-
【eclipse】eclipse报错:the resource is not on the build path of a java project