2

I'm aware of these nice answers to the previous SO question: specified JRE installation does not exist

However, I can't see how to make use of any of the answers. I've installed the Java JDK, Maven, Ant, Android SDK bundled with Eclipse, and am using Mac OS X Mavericks 10.9.5.

Is this as simple as setting the JAVA_HOME variable? If so, how do know what to set it to?

I'm brand new to Java so sorry for the noob question.

Tims-MacBook-Pro-retina:Github timrpeterson$ java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
Tims-MacBook-Pro-retina:Github timrpeterson$ javac -version
javac 1.8.0_20
Community
  • 1
  • 1
tim peterson
  • 23,653
  • 59
  • 177
  • 299

1 Answers1

3

This happens when the project is configured to use a specific JRE on someone's machine, rather than using an Execution Environment (EE). EE's are an abstraction above the physical JRE/JDK that is installed, and allow for portable project configurations (to avoid the problem you've run into). You can fix it by looking at your project in the Package Explorer view and finding its JRE System Library node. Right-click that and choose Properties. There you'll be able to select an Execution Environment for the project.

enter image description here

Depending on how your workspace is set up you might need to also use the Environments button there to configure the desired one in your workspace.

You can also get to the JRE System Library configuration via the project's properties - select the Java Build Path section and then the Libraries tab. Select the JRE System Library and then use the Edit... button to change it.

E-Riz
  • 31,431
  • 9
  • 97
  • 134
  • 1
    Edited the answer with another route to change it. – E-Riz Oct 09 '14 at 17:58
  • Hmm, this must have something to do with the concurrent Android installation as when I just install Eclipse it can find the path, but with the version of Eclipse I installed with Android, none of your or other people suggestions allows me to rescue these path issues. – tim peterson Oct 09 '14 at 19:27