I’ve been trying to do something weird with UiAutomator lately, but the version specified is JDK8. Unfortunately, the JDK version I installed last time I reinstalled my system was 12 😂😂😂.
At this point I thought, too simple! See my operation
brew cask install java8
Copy the code
but…
Error: No available formula with the name "java8"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
Copy the code
What? Don’t let install?
Then I found this note on the Oracle website:
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 no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here.
Commercial license and support is available with a low cost Java SE Subscription.
Oracle also provides the latest OpenJDK release under the open source GPL License at jdk.java.net.
My Oracle JDK license has been changed. If you want to use it in the future, you will have to pay. Otherwise, you can use OpenJDK
Okay, I’ll use OpenJDK
brew install adoptopenjdk8
Copy the code
When you!
Wait, what’s there to talk about? 😒 😒 😒
Oracle JDK is different from OpenJDK
Install Oracle JDK8
First use brew cask create java8 to install the cask of Java8, enter vim to edit and type the following text
cask 'java8' do
version '8u221' # version
sha256 'c49f96803c08b5fcd7cde1ccdcdc4fb483fc97c0fbadbbfe4c9020cdb26e79d6' # file sha256
url "https://download.oracle.com/otn/java/jdk/8u221-b11/230deb18db3e4014bb8e3e8324f81b43/jdk-8u221-macosx-x64.dmg" Oracle database will fail to download Oracle database. It is recommended to manually download and upload to Qiniu, obtain the download address of Qiniu, and fill in here.
name 'Oracle Java 8'
homepage 'https://www.oracle.com/technetwork/java/javase/overview/index.html'
app ' '
pkg "JDK 8 Update 221.pkg" # DMG open the file
uninstall pkgutil: "com.oracle.jdk#{version.major}u#{version.minor}"
end
Copy the code
Use :wq to save and exit.
This can be easily installed using Brew Cask install Java8.
So, Game over!