In this article, I will demonstrate how to install Java OpenJDK 15 on macOS Catalina in 2020.
Will there need to be a special release of OpenJDK to support the new Apple M1 chip? I see that there are currently downloads of the JDK for macOS/OS X, but these seem to only be for x86 processors. Is that correct? If so, where can I download a version of OpenJDK for the M1? How to solve this problem?
The java-1.6.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.6.0-openjdk-devel package. For a list of pointers to packages of the BSD Port for DragonFly BSD, FreeBSD, Mac OS X, NetBSD and OpenBSD, please see the BSD porting Project's wiki page. Dec 18, 2010 When OpenJDK was created, it adopted the most popular open-source licensing model for open source VMs at the time. The licensing model has served the project well over the years, ensuring its steady growth and adoption, while minimizing risks of proprietary forks and fragmentation.
- Mac OS X: The XCode 'command line tools' must be installed on your Mac. Information on GNU make, and access to ftp download sites, are available on the GNU make web site.
- DrJava correctly finds and labels Oracle JDK 7 compilers on Mac OS X. NOTE: Newer releases of Mac OS X include a gatekeeper that will not run unlicensed applications like DrJava unless you explicitly open DrJava by 'right' (control-key) clicking on the DrJava icon and executing the 'Open' command.
Download and Install OpenJDK 15
Download the .tar.gz
version of OpenJDK 15 from jdk.java.net/15/ and move the file to /Library/Java/JavaVirtualMachines/ on your mac. Then, extract it and delete the archive:
Next, execute the following command to find out where JDK 15 is located:
and append the resulting path as an export into your .bash_profile
(or, change the existing JAVA_HOME entry in your .bash_profile
if it already exists):
and make sure to apply the changes:
Test Java
You should now be able to run java:
Depending on your security settings, the following warning needs to be accepted by clicking “Open”:
You should then see an output similar to the following:
Congratulations! You have installed OpenJDK 15.
One more thing:
I’m currently working on a side project named pingmy.tech – it allows you to monitor the execution of regular background tasks such as backups and notifies you when they are not executed on time. Please check it out and create an account for free: https://www.pingmy.tech
Take a look at how you can quickly get started with OpenJDK with this tutorial that gives you commands for installing version 7-11 through a Mac Terminal.
Join the DZone community and get the full member experience.
Join For FreeIn this article, I will be using Homebrewto install OpenJDK versions on the Mac.
We use brew install
to install JDK versions 8,9,10, andbrew cask install
for version 11 and above.
All the brew commands are executed in the Terminal window on the Mac.
Install OpenJDK Versions 8, 9, and 10
brew tap AdoptOpenJDK/openjdk
Mac Os X Download Iso
brew search /adoptopenjdk/
The Formulae section contains the identifiers for the various JDK versions.
Mac Os X Download For Windows
To install a specific JDK version: brew install <identifier>
e.g. to install OpenJDK 8: brew install adoptopenjdk/openjdk/adoptopenjdk-openjdk8
JAVA_HOME should be set by the developer to /usr/local/Cellar/adoptopenjdk-openjdk8/jdk8u172-b11.
Install OpenJDK Version 11
brew cask install adoptopenjdk
JAVA_HOME should be set by the developer to /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk.
Opinions expressed by DZone contributors are their own.