苹果电脑 ( MacOS) brew 安装 Java

yufei       5 年, 8 月 前       1950

也是够无语的了,brew 安装 Javabrew install java 是不可能实现的

brew install java

Updating Homebrew...
Error: No available formula with the name "java" 
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
These similarly named formulae were found:
app-engine-java       google-java-format    javarepl              jslint4java           libreadline-java
To install one of them, run (for example):
  brew install app-engine-java
==> Searching taps...
==> Searching taps on GitHub...
These formulae were found in taps:
homebrew/linuxbrew-core/app-engine-java                 homebrew/linuxbrew-core/libreadline-java
homebrew/linuxbrew-core/google-java-format
To install one of them, run (for example):
  brew install homebrew/linuxbrew-core/app-engine-java

安装 Java 必须使用 brew cask java,这个安装的是最新版本的,也就是 Java 11

 java -version

openjdk version "11.0.2" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.2+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+7, mixed mode)

如果要安装旧版的,也不能使用下面的命令

brew cask install java8

必须 tap 以下才能安装,比如

brew tap caskroom/versions

然后你就可以使用下面的方式轻松的安装各个老版本了

brew cask install java8
brew cask install java6

那么,7, 9 和 10 怎么办呢? 我就不知道了,你知道了告诉我把

下面这样是行不通的

 brew cask install java10
 brew cask install java7
 brew cask install java9
目前尚无回复
简单教程 = 简单教程,简单编程
简单教程 是一个关于技术和学习的地方
现在注册
已注册用户请 登入
关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

  简单教程,简单编程 - IT 入门首选站

Copyright © 2013-2022 简单教程 twle.cn All Rights Reserved.