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

后端 未结 8 811
后悔当初
后悔当初 2020-12-24 05:39

When I try to use ctrl+space this error is shown:

This compilation unit is not on the build path of a Java project.

I see tha

相关标签:
8条回答
  • 2020-12-24 06:16

    Add this to .project file

     <?xml version="1.0" encoding="UTF-8"?>
            <projectDescription>
                <name>framework</name>
                <comment></comment>
                <projects>
                </projects>
                <buildSpec>
                    <buildCommand>
                        <name>org.eclipse.wst.common.project.facet.core.builder</name>
                        <arguments>
                        </arguments>
                    </buildCommand>
                    <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                    </buildCommand>
                    <buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
                        </arguments>
                    </buildCommand>
                    <buildCommand>
                        <name>org.eclipse.wst.validation.validationbuilder</name>
                        <arguments>
                        </arguments>
                    </buildCommand>
                </buildSpec>
                <natures>
                    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
                    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
                    <nature>org.eclipse.jdt.core.javanature</nature>
                    <nature>org.eclipse.m2e.core.maven2Nature</nature>
                    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
                </natures>
            </projectDescription>
    
    0 讨论(0)
  • 2020-12-24 06:17

    For those who still have problems after attempting the suggestions above: I solved the issue by updating the maven project.

    0 讨论(0)
提交回复
热议问题