How to put old Java (8 series) in macOS 10.15 Catalina

Introduction

Some tools don't work with Java version 12, and Google search for older Java didn't show useful information at the top, so I'll take a note here.

My environment

macOS 10.15 catalina Java is 12.0.2

% /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/openjdk-12.0.2.jdk/Contents/Home

What you want to do

I want to install Java 8 series.

Old Java installation.

This was helpful.

--Procedures for installing Oracle Java 8 (JDK) on macOS

D / L the JDK from the Oracle site. "Java SE Development Kit 8u202"-"Mac OS X x64" was selected.

https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
JDK.png

Make sure that JavaVirtualMachines has 8 series installed.

% /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/openjdk-12.0.2.jdk/Contents/Home
% /usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home

There is 1.8, but since it is newly added, it is only this, so it is probably 8 series. (suitable

Switch to old Java

You can't just install it, you need to switch JAVA_HOME.

I referred to here.

--Switch Java version on OS X

Put the following two lines in your shell settings, such as .profile or .bashrc.

export JAVA_HOME=$(/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home -v "1.8")
PATH=${JAVA_HOME}/bin:${PATH}

Version confirmation

% source ~/.profile
% java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

Finally

Even if you search Google by mixing various words centering on "install macOS old Java", it is painful because only the method of ** uninstalling ** old Java appears. .. Sometimes The way to install Java that you can find is no good now.

I melted a good amount of time. I hope that someone who seems to be addicted to it will be saved. ..

Recommended Posts

How to put old Java (8 series) in macOS 10.15 Catalina
How to name variables in Java
How to concatenate strings in java
How to implement date calculation in Java
How to implement Kalman filter in Java
Multilingual Locale in Java How to use Locale
How to do base conversion in Java
How to implement coding conventions in Java
How to embed Janus Graph in Java
How to display a web page in Java
How to get Class from Element in Java
[Java] (for MacOS) How to set the classpath
[Java] How to substitute Model Mapper in Jackson
How to solve an Expression Problem in Java
How to write Java String # getBytes in Kotlin?
Just put `clang 12.0.0` in macOS` Catalina` and put `ruby 3.0.0`
How to call functions in bulk with Java reflection
How to create a Java environment in just 3 seconds
[Java] How to omit the private constructor in Lombok
How to input / output IBM mainframe files in Java?
How to create a data URI (base64) in Java
How to generate / verify ID token in Java Memo
How to convert A to a and a to A using AND and OR in Java
How to convert a file to a byte array in Java
How to Git manage Java EE projects in Eclipse
Summary of how to implement default arguments in Java
Notes on how to use regular expressions in Java
[Java] How to use Map
How to lower java version
[Java] How to use Map
How to uninstall Java 8 (Mac)
How to use java Optional
How to minimize Java images
How to write java comments
How to use java class
[Java] How to use Optional ②
[Java] How to use removeAll ()
[Java] How to display Wingdings
[Java] How to use string.format
How to use Java Map
How to set Java constants
How to use Java variables
[Java] How to implement multithreading
How to initialize Java array
How to get the class name / method name running in Java
How to read your own YAML file (*****. Yml) in Java
What happened in "Java 8 to Java 11" and how to build an environment
How to use Java enums (Enum) in MyBatis Mapper XML
How to dynamically switch JDK when building Java in Gradle
How to develop and register a Sota app in Java
How to deploy Java application to Alibaba Cloud EDAS in Eclipse
Differences in how to handle strings between Java and Perl
How to switch Java in the OpenJDK era on Mac
How to use Lombok in Spring
How to find May'n in XPath
How to study Java Silver SE 8
How to use Java HttpClient (Get)
How to hide scrollbars in WebView
How to run JUnit in Eclipse
How to iterate infinitely in Ruby
Studying Java # 6 (How to write blocks)