Java 6 Macos Catalina

This article shows how to install Java JDK on macOS, Homebrew package manager, manual installation, and switch between different JDK versions.

The change bypasses the installer script's test for the MacOS version, allowing the Java 6 tools to be installed. I'm pretty sure they live in their own space and don't conflict with anything else. Note that you don't need to do this for IDL 8.8.

Tested with

  • macOS 11 Big Sur
  • Homebrew 2.7.4
  • JDK 8, 14, 16, 16 (AdoptOpenJDK and OpenJDK)

Topics

  • The fact that Logisim is prompting you to install Java 6 is an indication that it may only work with Java 6 and nothing newer. On Catalina, Java 6, and Apple's Java for OS X 2017-001 installer are now incompatible.
  • Oracle has revamped it's Java model and now sells the software. They now have an ' OpenJDK ' free version for end users. If you have an app that tries to use Java, it may be poorly written such that it will only attempt to use Apple's Java 6 which will not run on Catalina.

P.S At the time of writing, the latest JDK GA is JDK 15, and the early access build is JDK 16.

Note
Since macOS 10.15 Catalina, the default Terminal shell switch from the bash (Bourne-again shell) to zsh (Z shell). And we should move all the startup scripts and environment variables in ~/.bash_profile or ~/.bashrc to ~/.zshenv or ~/.zshrc.

Also, read this Zsh Startup Files.

1. Homebrew install latest Java on macOS

1.1 Install and upgrade Homebrew.

1.2 brew search java to find all available Java-related formula.

1.3 brew info to show the formula details.

The java formula is always containing the latest Java JDK (OpenJDK) GA version; at the time of writing, the latest GA is JDK 15.

Terminal

The java11 formula is containing the Java 11 LTS version.

1.4 brew install java to install the latest JDK 15.

Terminal

1.5 Where does Homebrew install the java?
Homebrew installed the JDK files and directories at /usr/local/Cellar/openjdk/, and symbolic link at /usr/local/opt/openjdk points to the latest Java 15.0.1 version.

1.6 The java formula is keg-only, which means it is installed in /usr/local/Cellar but not linked into places like /usr/local/bin or /Library/Java/JavaVirtualMachines/ (macOS /usr/bin/java wrapper).

For macOS /usr/bin/java wrapper to find the installed JDK, we manually create a symbolic link at /Library/Java/JavaVirtualMachines/.

Terminal

1.7 Done.

2. Homebrew install Java 8 on macOS

2.1 Install and upgrade Homebrew.

Java 6 Macos Catalina

2.2 The brew search java has no java8?

Terminal

2.3 The Java 8 is available at the openjdk@8 formula. The openjdk is the same as the java formula, and it always contains the latest JDK GA version; the openjdk@11 is the same as the java11 formula, containing JDK 11.

2.4 We can use the openjdk@8 formula to install Java 8 on macOS.

Terminal

2.5 The openjdk@8 is also a keg-only; we need to create a symbolic link so that the macOS java wrapper can find it.

2.6 Done.

Terminal

2.7 What if we have multiple Java versions installed?

We can update the $PATH at ~/.zshrc, so that the macOS can find the correct installed Java.

Terminal

$JAVA_HOME
Alternatively, we can set the $JAVA_HOME environment variable on macOS.

3. Homebrew install a specified Java (AdoptOpenJDK) on macOS.

The adoptopenjdk/openjdk tap containing a lot of different JDK (AdoptOpenJDK) versions.

3.1 Add a new tap (third party repository) adoptopenjdk/openjdk.

3.2 Search related adoptopenjdk formula.

Terminal
Update

3.3 We pick adoptopenjdk14 formula to install the JDK 14.

3.4 The adoptopenjdk formula creates the JDK home directly in the /Library/Java/JavaVirtualMachines/.

How To Install Java 6 On Mac Os Catalina

Terminal

3.5 Since the JDK home is already in /Library/Java/JavaVirtualMachines/, we do not need to create any symbolic link, just export $PATH and point it to the correct adoptopenjdk-14.jdk.

Note
Also read this Switch adoptopenjdk cask to use pkg #73145

4. Manual install Java (Early-Access Builds) on macOS.

For some reasons, we need to install Java on macOS manually:

  • Anti-Homebrew, developers love to control everything.
  • The JDK build doesn’t exist in the Homebrew repository, like the early-access builds, or Oracle JDK.

P.S At the time of writing, the JDK early-access build is JDK 16.

4.1 Access the JDK 16 early access build website and download the JDK.

4.2 Extracts the downloaded tar.gz file to /Library/Java/JavaVirtualMachines

Terminal

4.3 Update $PATH and point to the /Library/Java/JavaVirtualMachines/jdk-16.jdk

4.4 Test JDK 16.

Terminal

Done.

5. Switch between different JDK versions

From the above example 1 to example 4, we have installed four JDK versions on macOS.

5.1 List all the JDK versions on macOS.

5.2 Add the below function in the ~/.zshrc (for macOS 10.15 Catalina, and above) or ~/.bashrc Power plotter crack. (before macOS 10.15 Catalina).

~/.zshrc

P.S Create the file ~/.zshrc if it doesn’t exists.

5.3 Source the ~/.zshrc to reflect the changes.

5.4 Switch between different JDK versions.

Terminal

Further Reading
How to set $JAVA_HOME environment variable on macOS.

References

Java 6 Mac Os Catalina Update

mkyong

Founder 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.

With macOS 10.15, Apple introduced new application security checks, which are used by Gatekeeper to verify the contents of distributed software. When you install or run software for the first time, Gatekeeper verifies that the software has been notarized. See Notarizing Your App Before Distribution.

JDK 14 is the first release that complies with the new macOS 10.15 hardening and notarization requirements. If you want to install and test earlier versions of the JDK or JRE on macOS 10.15, this document explains some expect warnings and how to proceed.

As of the time when this article was written you can still install and run non-notarized software on macOS 10.15 systems by modifying your security preferences. The following steps show you how to install a non-notarized JDK or JRE.

Note: These steps use the JDK 8u231 macOS installer as an example. These steps apply equally to all other JDK and JRE releases.

Installing the JDK Using a .dmg File

  1. Double-click on the .dmg file to begin the installation. The system verifies the .dmg file, then opens a Finder window with the icon of an open box (package) and the name of the .pkg file.
  2. Double-click the package icon to start the installation app. A window appears with a status bar with text similar to the following:
  3. Then, a window appears with text similar to the following:

    'JDK 8 Update 231.pkg' can't be opened because Apple cannot check it for malicious software.

    This software needs to be updated. Contact the developer for more information.

    Click OK.

  4. Open System Preferences, click Security & Privacy, then click the General tab. In the section Allow apps downloaded from:, the following text appears:
  5. 'JDK 8 Update 231.pkg' was blocked from use because it is not from an identified developer.

    Click the Open Anyway button.

  6. A window appears with text similar to the following:
  7. 'JDK 8 Update 231.pkg' can't be opened because Apple cannot check it for malicious software.

    This software needs to be updated. Contact the developer for more information.

    Click the Open button.

  8. A window appears with the following text:

Java 6 Mac Os Catalina Free

Installer is trying to install new software. Enter your password to allow this.

Enter your user name and password, then click the Install Software button.

Installing the JDK from a File Archive

You don't have to modify your security preferences if you install the JDK from a .tar.gz file archive, in particular, a prebuilt OpenJDK package. However, the system may warn you the first time you run a Java command-line tool.

Running a Java Command-Line Tool for the First Time

When you run a command-line tool for the first time (such as java), depending on which app (such as Safari or Firefox) you used to download the installer, a window may appear with text similar to the following:

'jdk1.8.0_231.jdk' is an app created by Safari. Are you sure you want to open it?

Click the Open button.

Depending on the folder in which you installed the JDK or JRE, another window may also appear with text similar to the following:

'java' would like to access files in your Downloads folder.

Java 6 Macos Catalina Island

Click the OK button.