“Build path entry is missing” error when trying to create a new project in Eclipse

后端 未结 6 1853
孤城傲影
孤城傲影 2021-02-20 09:10

Build path entry is missing: org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7

相关标签:
6条回答
  • 2021-02-20 10:00

    I solved this by configure the .classpath file. I use maven and I deleted a line with some invalid setting in the marked place shown below.

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry kind="src" output="target/classes" path="src">
            <attributes>
                <attribute name="optional" value="true"/>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
                <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
            </attributes>
        </classpathentry>
    
        -----some files which is actually deleted in my project, I delete this line and all works fine------
    
        <classpathentry kind="output" path="target/classes"/>
    </classpath>
    
    0 讨论(0)
  • 2021-02-20 10:01

    This error is due to JRE System Library. Maybe you didn't give appropriate JRE for eclipse project to run. SO follow below steps.

    1. Right-click on the project and choose properties.
    2. Click on the Java Build Path option in the left side menu.
    3. From the Java Build Path window, click on the Libraries Tab.
    4. Make sure JRE System library is listed, if it is not listed then you can add, by clicking "Add Library" from the right side menu.
    5. So if JRE System Library is already listed then double click on JRE System Library which was showing error on Java Build Path window Libraries tab previously .
    6. Then it will open another window called JRE System Library . So in that window choose Alternate JRE . From that drop down choose your JRE.

    In my case, it is java-8-openjdk-amd64 , as I am using ubuntu 16.04. Like that you can also choose your JRE System library .

    0 讨论(0)
  • 2021-02-20 10:01

    Try to Copy any past two file (.classpath and .project) from an existing java project which is running properly, it is present inside your workspace.

    0 讨论(0)
  • 2021-02-20 10:02

    It is an old question, but I solved it by modifying JRE system library and select a valid Execution environment in my case (Mac OSX) JRE 1.6

    0 讨论(0)
  • 2021-02-20 10:05

    This is because JRE is not present in the build path of your project. So trying adding JRE from Windows->Preferences->Installed JREs and Add the default JRE. After that the JRE gets added by default in the build path of every project. This should solve the issue

    0 讨论(0)
  • 2021-02-20 10:07

    I already had JDK installed but i still had errors, so I opened command prompt locating it to my project: c:\project\proj>. Then I ran mvn clean && mvn install. That solved my issue !

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