76

I'm having trouble with a brand new project in a brand new installation of Eclipse. Repro steps:

  1. Download this version of Eclipse: http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliosr

  2. Unzip to c:\program files\eclipse java

  3. Launch Eclipse; choose a workspace

  4. File > New > Java Project

  5. Project name: Hello World. JRE: "Use an execution environment JRE: JavaSE-1.7"

  6. Hit Next, go to the Libraries tab. The only entry is JRE System Library [JavaSE-1.7] (unbound). What does "unbound" mean? How do I fix it?

  7. Hit Finish.

Expected: Brand new project works fine.

Actual: There are two errors:

The project cannot be built until build path errors are resolved HelloWord Unknown Java Problem Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project 'HelloWord' HelloWord Build path Build Path Problem 

What am I doing wrong here?

Update: Perhaps I don't actually have the Java 7 JDK on my machine. How can I be sure?

Update 2: Looks like Java 7 is in fact not out yet. Sweet.

5
  • 9
    This question should be reopened. I guess its now very relevant now that Java 7 is out. I used to have Java 6 configured in my eclipse, and the answer below helped me a lot. I think many people are experiencing this as well. Commented Jun 23, 2012 at 17:35
  • 8
    Seconding the vote to reopen. This is exactly what I was looking for. Commented Jun 25, 2012 at 18:37
  • 2
    This helped me over two years after it was asked. Should be reopened. It's hardly "too localised" as far as I can see Commented Dec 4, 2012 at 15:13
  • 2
    +1 on reopen, this helped me directly Commented Dec 8, 2012 at 13:56
  • I also ran into this coming from 1.7 to 1.8 recently. The version doesn't seem to matter. Eclipse is using some CDC-1.0 Foundation version, which is being labeled as 1.6 for some reason (even when it's 1.8). Changing it to use my installed system JRE (aka Alternate JRE) fixed the odd conflict warnings I was getting. And this was on a fresh new Eclipse Neon install. It should have detected my systems JRE's at first startup. Commented May 4, 2017 at 20:34

8 Answers 8

106

1) Find out where java is installed on your drive, open a cmd prompt, go to that location and run ".\java -version" to find out the exact version. Or, quite simply, check the add/remove module in the control panel.

2) After you actually install jdk 7, you need to tell Eclipse about it. Window -> Preferences -> Java -> Installed JREs.

Sign up to request clarification or add additional context in comments.

3 Comments

It's worth adding that on the preference pane for "Installed JREs", you can just hit the "Search" button to automatically locate JDK 7, if it is installed.
On Ubuntu 12.04, I found my installed jdks in /usr/lib/jvm
My setup is jdk8 + Eclipse 3.7. The problem "JRE System Library [JavaSE-1.7] (unbound)." still exist. Eclipse 3.7 does not bound jdk8 to Java7 environment. Any suggestion?
10

To set JDK you can watch this video : how to set JDK . Then when you'll have JDK:

  1. Right click on build path and select "Build Path"
  2. Choose "Configure Build Path"
  3. Click on "JRE System Library [JavaSE-1.7] (unbound)"
  4. Edit it
  5. Choose "Alternate JRE"
  6. Click on "Installed JREs.." button
  7. Press Add
  8. Choose to add "Standard VM"
  9. Choose JRE Home directory - usually it is locates in "C:\Program Files\Java\jre7" directory
  10. Press "Finish"
  11. Re-check newly appeared "Jre7": Verify that now when you edit "JRE System Library [JavaSE-1.7]" "Alternate JRE" is chosen for jre7.

Comments

8

1)Go to configure build path . 2)Remove unbound JRE library . 3)Add library --> JRE System library .

Then project compile and done ..

Comments

2

Have you actually downloaded and installed one of the milestone builds from https://jdk7.dev.java.net/ ?

You can have a play with the features, though it's not stable so you shouldn't be releasing software against them.

2 Comments

Looks like I haven't, unless it comes with that version of Eclipse.
Nah, you need to install from that site, it doesn't come with Eclipse (does Eclipse ship with a JVM in any case?).
2

Most of the time after the installation of Eclipse eclipse.ini is changed. If you change the jdk in eclipse.ini then eclipse will use this jdk by default.

Let's say you install a new version of Eclipse and you have forgotten to change the eclipse.ini related to the jdk. Then Eclipse finds a jdk for you. Let's say it is java 1.6 that was automatically discovered (you did nothing).

If you use maven (M2E) and you reference a 1.7 jdk then you will see the frustrating message. But normally it is not displayed because you configure the correct jdk in eclipse.ini.

That was my case. I made reference into the pom to a jdk that was not configured into Eclipse.

In the screenshot you can see that 1.7 is configured and seen by Eclipse. In this case, you should make reference into the pom to a jre that is compatible with 1.7! If not -> frustrating message!

jdk 1.7 configured in eclipse.ini and retrieved in installed jre

Comments

2

Cause : This is common scenario when we import new project with different lib and JAR path.

I faced this issue and got resolved using exact following steps:

  • Project > Properties
  • Build Path > Configure Build Path
  • Select "Libraries" tab
  • Click "Add Library"
  • Select "JRE System Library" from displayed list
  • Click on "Next" followed by "Finish" button

This will point your system's proper & valid JRE path, which did thing for me. Cheers :)

Comments

1

Updated eclipse.ini file with key value property -Dosgi.requiredJavaVersion=1.7 (or) 1.8 whichever applicable. - it works for me.

Comments

1

Updated eclipse.ini file with key-value property

-Dosgi.requiredJavaVersion=1.5 

to

-Dosgi.requiredJavaVersion=1.8 

because, that is my JAVA version.

Also, selected JRE 1.8 as my project library

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.