1. Install JDK 12
2. Install Eclipse 4.11
3. Install Eclipse Java 12 Support
Start Eclipse and go to Help > Install New Software. Add Update Site: https://download.eclipse.org/eclipse/updates/4.11-P-builds. Install Eclipse Java 12 support for 2019-03 development stream from the list of available software
4. Add Java 12 JRE to Eclipse
Go to Window > Preferences, navigate to Java > Installed JREs and add the Java 12 JRE (that you installed in Step 1). Tick the box to make it the default JRE
5. Upgrade Compiler Compliance Level
In your preferences, go to Java > Compiler and select “12” as the “Compiler compliance level”. In addition, tick “Enable preview features”.
That’s it! Now you can try out Switch Expressions!
Opinions expressed by Java Code Geeks contributors are their own.