This compilation unit is not on the build path of a Java project 解决办法
索发现,大致是因为项目文件缺失。
解决办法:找到项目根目录下的.project文件,修改,加入jdt支持,我的项目修改后如下所示↓
<projectDescription>
<name>yourProjectName</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>