Tag Archives: “This compilation unit is not on the build path”

“This compilation unit is not on the build path”

This compilation unit is not on the build path of a java project solution

When the project is imported into STS (eclipse based), there is a problem with the project

The code can’t prompt out, and all classes don’t jump with the method of Ctrl + click

There is an error as shown in the figure

Search found that, roughly because the project file is missing

Solution: find the. Project file in the root directory of the project, modify it, and add JDT support. My project is modified as shown below

<?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>