2 minutes
Eclipse vs. Java 14 (on MacOS)
This post serves as a reminder of how I got the new Eclipse 2020-03 build running with AdoptOpenJDK 14.
I did this because I wanted to dive into Java 14 and especially the new preview feature for records. Of course I could do that while still running Eclipse on a stable and fully supported Java version like Java 11 (or even Java 8) but then again – why not go all the way?
Eclipse and Java 14
To run Eclipse with Java 14 you need three things.
First you’ll need to download and install the latest version of Eclipse. As of this writing the latest version of Eclipse is 2020-03. Get it here: https://www.eclipse.org/.
Next is Java 14. I have chosen to run the AdoptOpenJDK variant. You can either download and install it manually from https://adoptopenjdk.net/ or install it via your favourite package manager. I’m on MacOS and installed it with Macports using this command:
sudo port install openjdk14
For Mac users you might need to do one final thing. I write might because the issue might have been fixed when you read this. Try to start Eclipse (or the Eclipse Installer) – if it starts as expected then you are good to go.
Otherwise you might need to apply the following little hack:
- Open Terminal.app
cd /Library/Java/JavaVirtualMachines/openjdk14/Contents/MacOS
sudo ln -sf ../Home/lib/libjli.dylib libjli.dylib
Thanks to Ari Hannula for this tip
and Jean-Pierre Matsumoto for pointing out
that libjli.dylib
is not always in the same location.
Now try to start Eclipse. It should start up correctly and if you go to
About Eclipse -> Installation Details -> Configuration you should see that is is
indeed running on Java 14 (java.version=14
)
Next step: Write some code using the Java 14 Preview Features!