Moon Light Box

Time is Money

Linux - Install Oracle JDK1.8 in CentOS 7

| Comments

Step 1.

# yum remove *openjdk* -y
# cd /opt
# wget http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.tar.gz
# tar zxvf jdk-8u102-linux-x64.tar.gz
# ln -s jdk1.8.0_102/ jdk

Step 2.

# vim /etc/profile.d/java-sdk-env.sh

Add below.

export JAVA_HOME=/opt/jdk
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

Step 3.

# source /etc/profile

Step 4.

# cd /opt/jdk1.8.0_102/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_102/bin/java 2
# alternatives --config java

There are 1 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /opt/jdk1.8.0_101/bin/java

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

# alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_102/bin/jar 2
# alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_102/bin/javac 2
# alternatives --set jar /opt/jdk1.8.0_102/bin/jar
# alternatives --set javac /opt/jdk1.8.0_102/bin/javac

http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/#

java

Comments

comments powered by Disqus