Eclipse – Unbound classpath container: ‘JRE System Library [OSGi/Minimum-1.2]’ in Eclipse Juno

classpatheclipse

For my class I imported code from an online source given to us by the professor and tried to run it in Eclipse Juno (i'm not sure if it makes a difference what version) And I got the error message "Unbound classpath container: 'JRE System Library [OSGi/Minimum-1.2]' in project 'cs112'" I researched several answers to this problem and tried multiple solutions including building a path and adding a library, which i named JRE, and setting the correct execution environment! What could I possibly be doing wrong? Please help!!

Best Answer

In the Preferences (Menu Window, Preferences), find "Java", "Installed JREs". You should have at least one JRE, better a JDK available. Then, in the same section, there's a sub-section "Execution Environments".

The project you're trying to use asks for "OSGi/Minimum-1.2". The "Execution Environments" preference section allows you to view and adjust how the available JREs are mapped to requested execution environments. If none of your JREs are listed as compatible with the requested environment, you may have to

  1. Install a new JRE or JDK, for example a recent Java 1.7
  2. and, this is important, tell Eclipse about that new JRE by adding it to the "Installed JREs". Select "Add" -> "Standard VM" -> Point to "jdk1.7.xxx".