mac卸载和安装java指定版本
本文最后更新于 1485 天前,其中的信息可能已经有所发展或是发生改变。

2020-04-02更新:

之前的安装方法已经废弃了,可通过以下方式安装

brew tap AdoptOpenJDK/openjdk
brew cask install <version>

这里有全部的version列表

例如可以这么安装

brew cask install adoptopenjdk8

 


 

之前用brew安装了java9。但我有些软件不兼容,只能降级到java8。这里简单记录下步骤。

卸载

brew cask uninstall java

安装指定版本

brew tap caskroom/versions
foam@foamdeMBP: sens » brew cask search java                                                                                                                                         [15:13:54]
==> Exact Match
java
==> Partial Matches
charles-applejava                     eclipse-javascript                    java6                                 netbeans-java-ee                      yourkit-java-profiler
eclipse-java                          java-jdk-javadoc                      java8                                 netbeans-java-se

估计我没更新brew的缘故,上面只列出java6和java8。java7呢,有点懵逼。

键入下面命令,然后就会自动下载安装了。可能会有点慢,挂个代理或VPN好些。

foam@foamdeMBP: sens » brew cask install java8
Updating Homebrew...
^CWarning: Unexpected method 'license' called during caveats on Cask java8.
Follow the instructions here:
  https://github.com/caskroom/homebrew-cask#reporting-bugs
==> Caveats
This Cask makes minor modifications to the JRE to prevent issues with
packaged applications, as discussed here:

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361

If your Java application still asks for JRE installation, you might need
to reboot or logout/login.

==> Satisfying dependencies
==> Downloading http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-macosx-x64.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask java8
==> Installing Cask java8
==> Running installer for java8; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is JDK 8 Update 172
==> installer: Installing at base path /
==> installer: The install was successful.
🍺  java8 was successfully installed!

确认下,ok了。

foam@foamdeMBP: sens » java -version                                                                                                                                                 [15:46:05]
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

 

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇