IlhamiD
IlhamiD

Reputation: 153

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

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

I get this error when I create a new project in Eclipse. I am using Ubuntu by the way.

Can anyone help me fixing this?

Upvotes: 13

Views: 106726

Answers (7)

Remnant Saai
Remnant Saai

Reputation: 1

When you create a new project on Eclipse (file -> others -> java -> Java Project), on the "Create Java Project", after you typed your project's name, scroll down a bit and "tick" the [create module-info java file].

Click next. It'll ask you for your module's name. You can give whatever you want.

Then on the right side "project explorer", in the src package, create a class. It'll show errors. At that time, just delete your "module-info.java" file which should be inside the same [src] file.

Now you can run your project. At least that's how I got it worked.

[Edit] - Alternatively, if you create a new package inside the "src" package and then you create your classes in that newly created project, you necessarily don't have to delete "module-info.java".

Upvotes: 0

Satyendar Yadav
Satyendar Yadav

Reputation: 1

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.

Upvotes: 0

FuyaoLi
FuyaoLi

Reputation: 1

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>

Upvotes: 0

alia
alia

Reputation: 1

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 !

Upvotes: 0

PyDevSRS
PyDevSRS

Reputation: 1865

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 .

Upvotes: 35

Aarish Ramesh
Aarish Ramesh

Reputation: 7023

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

Upvotes: 1

gogasca
gogasca

Reputation: 10048

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

Upvotes: 9

Related Questions