81
74

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macにjava8をインストール

Last updated at Posted at 2016-02-23

macにjava8をインストール

環境

現在の状態

Mac Book Air
OS X Yosemite

brew で install

現在はbrewで入れたjava7がインストールされている状態

java8 インストール 手順

1. brewを更新

brew update && brew cleanup

2. java8インストール

brew cask install java

3. インストールされてる全てのバージョンを確認

/usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    1.8.0_74, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home
    1.7.0_72, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home

4. .bash_profileとか.zshrcに書く

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

5. 設定したバージョンを確認

java -version 

6. 消すとき

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
81
74
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
81
74

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?