• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install Java on macOS

Written by Rahul, Updated on October 8, 2019
MacOS java, macOS

Java is a general-purpose, secure, robust, object-oriented language developed by Sun Microsystems in 1990. Java is portable which means it follows to write once run anywhere paradigm. The latest version is Java 13 which was released on March 2019. This tutorial helps you to install Java 13 latest or Java 11 LTS on macOS Sierra or High Sierra.

Step 1 – Prerequisites

Before starting the installation of Java using this tutorial you must have the following prerequisites

  • Terminal: You must have Mac Terminal access and little knowledge about working with the terminal application. Ao login to your Mac system and open terminal
  • Homebrew: This tutorial relies on Homebrew, So you must have homebrew installed. Homebrew can be installed with a single command.
  • ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

    For more instruction visit Homebrew installation tutorial.

Step 2 – Install Homebrew Cask

On Mac systems, Homebrew is the package manager, and Homebrew Cask is the app manager built on top of Homebrew. You Execute command to update brew cache and tap the caskroom/cask.

brew update
brew tap caskroom/cask

Step 3 – Install JAVA with Homebrew Cask

At the time of writing this tutorial the available version, Java 11 LTS and Java 13 latest for the installation. Use the following commands to view the details about java versions to be install.

brew tap caskroom/versions
brew cask info java11              ## For Java 11 LTS 
brew cask info java                ## For Java 13 (latest version)

Now, install the Java version of your choice using one of the below commands. You can also install both versions if required.

brew cask install java11           ## Install Java 11 LTS 
brew cask install java             ## Install Java 13 (latest version)

I have installed Java 11 on my MacOS system. The download process may take some time to complete depending on your network speed. Once the installation finished, verify the installed Java version.

java -version

java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

All done. Your Mac system has installed Java on it.

Share it!
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Related Posts

  • How to Install Java 11/8 on Fedora 31/30/29

    October 6, 2019
  • How to Install Java 11/8 on Amazon Linux

    October 5, 2019
  • How to Install Java on CentOS 8

    September 18, 2019
  • How to Install GIMP on MacOS

    September 7, 2019
  • How to Install Angular CLI on macOS

    August 4, 2019

11 Comments

  1. Avatar Ram Reply to Ram
    October 10, 2019 at 11:41 pm

    For macos mojave

    brew tap homebrew/cask-versions
    brew cask info java11
    brew cask install java11

    • Avatar Mateo Reply to Mateo
      November 1, 2019 at 11:14 pm

      And still `brew cask install java` for java 13

  2. Avatar Ruth Reply to Ruth
    October 7, 2019 at 3:32 pm

    how do you install java12 now that java 13 will be installed when using “java”?

    • Rahul Rahul Reply to Rahul
      October 8, 2019 at 4:28 am

      Thanks, Ruth, The article has been updated with latest versions.

  3. Avatar john Reply to john
    August 16, 2019 at 12:40 pm

    Just go to https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html
    with an Oracle account….

  4. Avatar matej simunic Reply to matej
    May 20, 2019 at 10:12 am

    perfect, ty

  5. Avatar Robert Reply to Robert
    August 11, 2018 at 5:43 pm

    Worked perfectly on my MAC. Thank you!!

  6. Avatar Robert Reply to Robert
    August 11, 2018 at 5:42 pm

    Worked Perfectly for my on my MAC. Thank you for this.

  7. Avatar T Reply to T
    July 15, 2018 at 11:43 am

    Thanks

  8. Avatar BobK Reply to BobK
    May 8, 2018 at 9:30 pm

    Perfecto! Thankyousir.

  9. Avatar Tyler Reply to Tyler
    February 15, 2018 at 12:48 am

    Thanks a lot… Got Java installed successfully on my Mac

Leave a Reply

Cancel reply

Popular Posts

  • How to Install Python 3.8 on Ubuntu, Debian and LinuxMint
  • How to Restart Network Service on CentOS 8 or RHEL 8
  • How to Check IP Address on CentOS 8
  • How to Install Java 11/8 on Amazon Linux
  • How to Configure Static IP on CentOS 8 (CLI)
Copyright © 2013-2019 TecAdmin.net. All Rights Reserved. This site uses cookies. By using this website you agree with our term and services
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkNo
Revoke cookies