「This compilation unit is not on the build path」

This compilation unit is not on the build path of a Java project 解決辦法 java

把項目導入STS(基於Eclipse)時,項目出現問題, apache

代碼提示出不來,並且全部的類用Ctrl+click的方法也無跳轉。 eclipse

有提示如圖錯誤 ui



搜索發現,大體是由於項目文件缺失。 code

解決辦法:找到項目根目錄下的.project文件,修改,加入jdt支持,個人項目修改後以下所示↓ xml


<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>V4</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>
		<nature>org.apache.ivyde.eclipse.ivynature</nature>
	</natures>
</projectDescription>
相關文章
相關標籤/搜索