如何使用自制软件在 osx macOS Mojave 上安装 java 8?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/53772023/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 00:54:08  来源:igfitidea点击:

How to install java 8 on osx macOS Mojave with homebrew?

javamacoshomebrew

提问by d0x

At the moment Java 8 is still required for some apps like:

目前,某些应用程序仍然需要 Java 8,例如:

  • Android SDK / Android Studio
  • Jenkins
  • Ionic ...
  • Android SDK / Android Studio
  • 詹金斯
  • 离子...

With brew install javathe latestVersion is installed. But how to install Java 8?

随着brew install java最新安装版本。但是如何安装 Java 8?

采纳答案by Andrew Janke

The older Oracle JDKs are gone from Homebrew now. Use OpenJDK instead:

较旧的 Oracle JDK 现在已经从 Homebrew 中消失了。改用 OpenJDK:

brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk8

OpenJDK is a drop-in replacement for the Oracle JDK in most places, so this should work fine for you with no code or build process changes.

在大多数情况下,OpenJDK 是 Oracle JDK 的直接替代品,因此这对您来说应该可以正常工作,无需更改代码或构建过程。

回答by d0x

This answer is outdated.

这个答案已经过时了。

You can install Java 8 on macOS Mojave like this:

您可以像这样在 macOS Mojave 上安装 Java 8:

brew tap caskroom/versions
brew cask install java8

In case the latest java version was already installed, uninstall it with:

如果已经安装了最新的 Java 版本,请使用以下命令卸载它:

brew cask remove java