

If we want to use the Java 8 language features the –source should be set to 1.8. You can select the level 1.6, 1.7, 1.8 by configuring the maven-compiler-plugin source and target attributes, like this Īnd ideally, if you have a parent pom, you can do it for all the modules (Eclipse projects) in the parent pom, in one single place. Project Properties, Java Build Path, Libraries, Add Library, JRE system library, Workspace default or Alternate JRE (one of the JREs configured inīUT IF you are using maven, provided that you have your latest JRE (Windows/Preferences/Installed JREs) -for example JDK 1.8.Project Properties, Java Compiler, Enable project specific settings (or configure Workspace settings), JDK Compliance.Windows -> Preferences -> Installed JREs, to configured the installed JDKs.Your code will still be compiled and run by the JDK you’ve selected. This feature is useful for ensuring backwards compatibility of your code. In the JRE home, navigate to the folder you’ve installed the JDK (For example, in my system my JDK was in C:\Program Files\Java\jdk1.8.0_181\ )Īfter completing the above steps, you are done now and eclipse will start using the selected JDK for compilation.Įclipse’s compiler can assure that your java sources conform to a given JDK version even if you don’t have that version installed.Then click Add and select Standard VM then click Next.Select the Window menu and then Select Preferences.To tell eclipse to use JDK, you have to follow the below steps. Now you should see all installed JREs, select the one you want.If not, click Search…, navigate to Computer > Windows C: > Program Files > Java, then click OK.If you see JRE you want in the list select it (selecting a JDK is OK too).Select “Java Build Path” on left, then “JRE System Library”, click Edit….Here is the complete sequence in Eclipse Luna: Some additional steps may be needed to set both the project and default workspace JRE correctly, as MayoMan mentioned. I think that’s why you’re seeing the addition version options. Some compilers can be configured to compile at a back-level compiler version. In the project build path configuration dialog, under the libraries tab, you can delete the entry for JRE System Library, click on Add Library and choose the installed JRE to compile with.

You manage the list of available compilers in the Window -> Preferences -> Java -> Installed JRE's tab.
