I'm trying to update Java to Version 11, but don't want to use Oracles JDK because of the license. I also would like to install and use AdoptOpenJDK 8 because of that. My OS is Windows 10.
I've already tried to install AdoptOpenJDK 11 without overwriting any settings, as I want other java-programs to still run using Oracles JRE 8. I added the AdoptOpenJDK installation folder to the installed JREs in eclipse and when I ran some test code, "java.version" was set to 11.0.7, but when trying the new 'var' feature, Eclipse said that 'var' is not allowed here
. I changed the compiler compliance level to 11 and updated to Eclipse Version 2020-03 (4.15.0), but it still didn't work.
Then I reinstalled AdoptOpenJDK 11 and let the installer change all the settings, but it still wouldn't work.
How can I install AdoptOpenJDK 8 and 11 parallel to OracleJDK 8 on my system and set in Eclipse which one to use per project?
EDIT: Ok, it works now, apparently I just didn't understand how to use 'var' correctly. Thank you for your help nonetheless.