11

I have jre8 installed and set as the default for the jre but under compiler compliance I can't find 1.8 and under execution environment I can't find javaSE 1.8. I'm using the latest build of Eclipse EE.

I took a look at this manual http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-add_new_jre.htm But I couldn't find any .ee files in my jre8 or JDK1.8 installation directories.

geoxile
  • 348
  • 1
  • 6
  • 16
  • You need to install a JDK to get compiler options. – Elliott Frisch Aug 19 '14 at 19:22
  • Yes, as mentioned I have JDK1.8, JDK1.8.0_11 specifically, installed. – geoxile Aug 19 '14 at 19:27
  • Can you verify what version of Eclipse you are looking at? Use the About Eclipse menu option. Luna has Java 8 support (including a Java 1.8 execution environment) out of the box, even if you don't have a 1.8 JRE available. I just double-checked, and it's there even though I have no Java 8 locally. – E-Riz Aug 19 '14 at 19:30
  • Version: Luna Release (4.4.0). I upgraded directly from Kepler SR2 I think – geoxile Aug 19 '14 at 19:32
  • 1
    Try a clean download of Luna. In general it's recommended to do that as opposed to updating across major releases. – E-Riz Aug 19 '14 at 19:33
  • Okay, so if I just delete the folder everything will be completely wiped right? Including the configs? – geoxile Aug 19 '14 at 19:37
  • Yes. Installing Eclipse is just extracting it to a location on your file system. When installing a new instance, always use a different location; don't install over the top of an existing one. You can then point the new installation at any existing workspace and you should be off and running. – E-Riz Aug 20 '14 at 13:14
  • Okay, deleting the folder and installing a completely new instance worked. JavaSE 1.8 was detected just fine. – geoxile Aug 22 '14 at 23:31
  • @geoxile: I had a similar issue where I had JDK 1.8 installed but the compiler compliance didn't have 1.8 option available. I had upgraded from Juno to Luna. Finally how I was able to fix this was bizarre. The java 8 lambda expressions of my code was highlighted as error and the suggestion to fix the error said change settings to 1.8. Clicking on that suggestion removed the error highlighting and now I have 1.8 in my drop down options as well. – Sanjay Nambiar Apr 29 '15 at 07:10

3 Answers3

17

Open Preferences and look in 'Java > Installed JREs'. If you don't have a Java 8 shown there click 'Add...' to add it. Close the preferences.

Open Preferences again and look in 'Java > Installed JREs > Execution Environments', select 'JavaSE-1.8' and make sure your Java 1.8 is checked as the Compatible JRE

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • +1 The "close the preferences" step seems a bit odd, since one would hope that pressing "apply" would be enough, but it is apparently necessary as of Luna. – Theodore Murdock Feb 29 '16 at 23:44
  • @MikeRoger The location of Preferences varies depending on the platform - on macOS it in the 'application' menu not Windows. – greg-449 Jul 28 '17 at 09:32
  • On Windows, "Preferences" under the "Window" top menu. Thanks @greg-449 for macOS info. – MikeRoger Jul 28 '17 at 13:02
13

If the eclipse version is old as @mike stated in his answer then you would be unable to view the JavaSE-1.8 on the Execution Environments list in your eclipse; You can do the following to use it even on older versions:

Or just download and use the latest eclipse

E_X
  • 3,722
  • 1
  • 14
  • 15
5

Older versions of Eclipse might not work with javaSE-1.8

You need to find out what version of Eclipse you have by going into its help menu and clicking on About Eclipse.

If your version is older than the one at https://www.eclipse.org/downloads/ then you need to uninstall your older version and install the latest version.

I had the same problem with my Eclipse on Linux Mint. And the only way I could solve it was by following above instructions.