LoginSignup
0
0

More than 5 years have passed since last update.

コマンドのみでJDKをインストール

Posted at

Env

  • OSX 10.11.3

Ref

How to

# ダウンロード
$ wget -P ~/Downloads --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-macosx-x64.dmg
...
# マウント
$ hdiutil mount jdk-8u102-macosx-x64.dmg
...
# パッケージインストール
$ sudo installer -pkg /Volumes/JDK\ 8\ Update\ 102/JDK\ 8\ Update\ 102.pkg -target /
...
# アンマウント
$ umount /Volumes/JDK\ 8\ Update\ 102
# パスを通す
$ echo "export JAVA_HOME=`/usr/libexec/java_home -v 1.8`" >> ~/.zshrc
$ echo 'export PATH=$PATH:$JAVA_HOME/bin' >> ~/.zshrc
$ . ~/.zshrc
0
0
0

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
0
0