This article shows you how to install Java on Mac OSX, and also how to do Java/JDK version switching.
- The Vendor column indicates whether the Java release is supplied by Apple or Oracle. The Version column specifies the version of Java that is installed. Reordering the list, by dragging Java SE 10 to the top, makes it the default version of Java. If you install only Oracle Java JRE 10, then it will not appear in.
- Important Oracle JDK License Update. The Oracle JDK License has changed for releases starting April 16, 2019. The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost - but other uses authorized under prior Oracle JDK licenses may.
- Mac OS 10.15.3
- JDK 8, 9, 10, 11, 12, 13 (AdoptOpenJDK)
On Mac OSX, Java should installed in this folder; it is Mac’s standard.
We will show you two ways to install Java JDK on Mac, via the popular Homebrew package manager and manually installation.
1.1 Install Homebrew and update it.
1.2 Add adoptopenjdk/openjdk.
1.3 Find all available JDK.
The output may vary.
1.4 Java 8, 9, 10, 11, 12, 13, choose one to install.
This example will install Java 8 and 11 for testing.
1.5 Where Java is installed?
Homebrew will install the JDK at folder
/Library/Java/JavaVirtualMachines/, and this folder is Mac’s standard folder for Java installs.
1.6 Test it, by default, Mac takes the highest version.
1.7 How to do version switching? Refer to below 3. version switching
2. Manual installation
The example shows you how to download the early access JDK 14 and install it on Mac OSX.
- Download JDK.
- Puts the JDK folder at
2.1 Download the early access JDK 14 from the OpenJDK website.
2.2 Extracts tar file to
Java 1.7 Download Mac
Find out where is JDK 14.
Create or edit the existing
~/.bash_profile with a text editor.
JAVA_HOME, save and exit.
Reflect the changes
2.4 Test it.
3. Version Switching
In this tutorial, we installed the Java 8 and Java 11 via
Homebrew (Step 1), and Java 14 manually (Step 2), so this Mac has three versions now. And the Mac is using the JDK 14.
There are tools like jEnv to manage the Java version switching, but I prefer to manage with
export JAVA_HOME manually, it’s simple and easy to understand, no black box magic.
3.1 Create or edit the existing
~/.bash_profile with a text editor like vim or nano,
export JAVA_HOME to the specified JDK we want to use on Mac.
Download Java For Mac 10.8.5
The above changes will make
JAVA_HOME point to JAVA 8.
3.2 Reflect the changes.
If we want to switch JDK version again, update the
export JAVA_HOME to other JDK version.
mkyongFounder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.
I am trying to create my first macro with LibreOffice version 184.108.40.206 on a MacBook Pro running Mac OS X 10.14.5. When I select menu item 'Tools Macros Run Macro' I get this popup box: 'LibreOffice requires Oracle's Java Development Kit (JDK) on Mac OS X 10.10 or greater to perform this task. Please install them and restart LibreOffice.' However, the title of the popup box is 'JRE Required'.
I found a potential answer to this problem in the question 'Mac Java problem when creating a database' but the detailed directions talk about installing the JDK. The error messages I got in the popup implied that I need both the JDK and the JRE.
When I install the JDK will I also get a copy of the JRE? What are the current instructions for installing the needed Oracle libraries if I want to use macros?
When I install the JDK will I also get a copy of the JRE?
Yes. As I understand, Oracle doesn’t provide a JRE alone. Sorry, I can’t give any other pointer as I don’t use Mac.
@gabix There is a JRE for Mac OS X (current versions filename is
jre-8u221-macosx-x64.dmg), but LibreOffice can't deal with that.
I meant the current Java, not the old Java 8.
E-bot, why not repost it as an answer?
Since I work with Windows and not with Mac, I only saw it as an additional hint. And the question was already marked as solved. If it still helps, so much the better. Have all your joy in it.