[CentOS/Ubuntu] Java8インストール

Facebook にシェア
Pocket
LINEで送る
このエントリーを Google ブックマーク に追加

CentOS

Java8サイト で最新版のrpmのURLを取得しておく。

[shell] cd /usr/local/src
wget –no-check-certificate –no-cookies –header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm
rpm -Uvh jdk-8u91-linux-x64.rpm
sudo alternatives –config java

There is 1 program that provides ‘java’.

Selection Command
———————————————–
*+ 1 /usr/java/jdk1.8.0_91/jre/bin/java

Enter to keep the current selection[+], or type selection number:1
[/shell]

Ubuntu

[shell] sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
java -version

java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
[/shell]

Related posts

コメントを残す