Linux/Java

From Omnia
Revision as of 21:59, 30 June 2017 by Kenneth (talk | contribs) (→‎Installation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Manual Installation

Java

# RPM
sudo su -
cd /opt
# http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
# wget http://install.oeey.com/jdk-6u45-linux-x64-rpm.bin
wget http://install.oeey.com/jdk-6u45-linux-amd64.rpm
rpm -Uvh jdk-6u45-linux-amd64.rpm
ln -s /usr/java/jdk1.6.0_23 java
# Non-RPM
sudo su -
cd /opt
# http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
wget http://install.oeey.com/jdk-6u45-linux-x64.bin
chmod u+x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
ln -s jdk1.6.0_45 java
echo "export JAVA_HOME=/opt/java" >> ~/.bashrc

Installation

Java SE JDK

sh jdk-6u25-linux-x64-rpm.bin

Installed to:

/usr/java/jdk1.6.0_25

Path:

export PATH=/usr/java/jdk1.6.0_25/bin:$PATH

Java 8

# For RHEL
yum -y install java-1.8.0-openjdk
# For Ubuntu
add-apt-repository -y ppa:webupd8team/java
apt-get update
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
apt-get -y --force-yes install oracle-java8-installer oracle-java8-set-default

Alternative

rpm -Uvh /path/to/binary/jdk-7u55-linux-x64.rpm
alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 200000
/usr/sbin/alternatives --display java
/usr/sbin/alternatives --config java

References: