LoginSignup
2
1

More than 5 years have passed since last update.

MacでインストールせずにJava9を試す

Posted at

Java9を試したいけど、既存のJava環境を上書きしたくない…。

ということで、 dmg 形式のメディアから pkg 形式のインストーラを取り出して、そこからhomeディレクトリ相当のバイナリを取得してみましょう。

JDKのダウンロードはこちらから。 "Accept License Agreement" をクリックしてダウンロードします。
http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html

ダウンロードできたら、 jdk-9_osx-x64_bin.dmg をダブルクリックしてマウントします。
続いてpkgを展開します。

$ cd /Volumes/JDK\ 9
$ pkgutil --expand JDK\ 9.pkg /path/to/expand

/path/to/expand/tmp/jdk9 などの適当なディレクトリで。(再起動などのタイミングで消したくなければ /tmp 以下は使わないで下さい。)

続いて、更にその中の gzip アーカイブを展開します。

$ cd /path/to/expand
$ cd jdk9.pkg/
$ tar zxfv Payload

成功すれば Contents/Home 以下にバイナリが展開されているはずです。

2
1
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
2
1