简体   繁体   中英

Is it possbile to use Java SE version above 8 in Eclipse or any other IDE?

I want to use the new JDK 11 (Version 11.0.2) in my Projects and i installed it right away. I also set my path variable to the JDK and deleted the old JAVA_HOME variable. But when i want to set the new build path in exlipse it is saying Java SE 11 (and also 9 and 10) are unbound. Im just able to use Java SE 8 and below.

I tried to set my path variable and my JAVA_HOME variable correctly to C:\\Program Files\\Java\\jdk-11.0.2 and C:\\Program Files\\Java\\jdk.11.0.2\\bin but that did not work for me. Also i figured out that my JDK is set to java version 11.0.2 by using the command prompt

javac -version
--> javac 11.0.2

Java version is still 1.8.0_202

java -version
--> java version "1.8.0_202"
--> Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
--> Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

Tell Eclipse about the JDK/JREs you want it to use in the Preferences in 'Java > Installed JREs'.

Connect the execution environments to a JDK/JRE in the Preferences in 'Java > Installed JREs > Execution Environments'.

Set the compiler compliance levels you want in the Preferences in 'Java > Compiler'.

For individual projects specify the JDK/JRE to use in the project Properties in the 'Java Build Path' page (Libraries tab).

You can also set compiler compliance levels for a Project in the 'Java Compiler' properties.

Use the 'Run > Run Configurations' to set the JDK/JRE used when running your program from within Eclipse.

For full Java 11 support you need to be running the current Eclipse (2019-03) or Eclipse 2018-12, earlier versions don't support it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM