0
0

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.

JDKをインストール(OS:CentOS6.7 IED:Eclipse Mars)

Posted at

概要

Eclipse MarsのデフォルトのJREは下記の通り。
java-1.7.0-openjdk-1.7.0.79.x86_64

Java8の機能を使いたかったのでJDK1.8をインストールした。

JDKをダウンロード

wget http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.tar.gz?AuthParam=xxxxx

GUIでLisence Agreementに同意しないとダウンロードできない。
xxxxxは(多分)乱数でダウンロード毎に違う英数字が割り当てられる。

名前を変更する

mv jdk-8u72-linux-x64.tar.gz\?AuthParam\=xxxxx jdk-8u72-linux-x64.tar.gz

展開する

tar zxvf jdk-8u72-linux-x64.tar.gz

./configureを実行しようとしたがエラーになった。
コンパイルは必要ないです。

移動する

[~/ダウンロード]に展開したので、Eclipseの既定のディレクトリに移動した。
既定のディレクトリは下記の手順で調べられる

  1. Project>Properties>Java Build Path>[Libraries]タブ内の[Edit]をクリック
  2. Edit Libraries>[Installed JREs]をクリック
  3. Installed JREsの[Edit]をクリック
  4. Edit JREの[JRE home]に既定のJREの保存場所が表示される

後付けだが、下記のコマンドでもいいかもしれない

find / -type d -name jre
mv ~/ダウンロード/jdk-8u72 /usr/lib/jvm

Eclipseに設定する

「移動する」で示したとおりにリンクをたどり、

  1. Installed JREsの[Add]をクリック
  2. Add JRE>Installed JRE Types:で[Standard VM]を選択し[Next]をクリック
  3. Add JRE>JRE Definitionが表示されるので下記のとおり設定する
  4. JRE home:/usr/lib/jvm/jdk-8u72
  5. JRE name:jdk1.8.0_72

Java8が利用できるようになりました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?