I am trying to install Java from Oracle because I am going to develop some software in it.
I have downloaded the file jdk-8u131-linux-x64.tar.gz
Then in terminal as root:
Code: Select all
cp jdk-8u131-linux-x64.tar.gz /opt/java/jdk.tar.gz
cd /opt/java
alternatives --install /usr/bin/java /opt/java/jdk1.8.0_131/bin/java 2
alternatives version 1.7.2 - Copyright (C) 2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: alternatives --install <link> <name> <path> <priority>
[--initscript <service>]
[--family <family>]
[--slave <link> <name> <path>]*
alternatives --remove <name> <path>
alternatives --auto <name>
alternatives --config <name>
alternatives --display <name>
alternatives --set <name> <path>
alternatives --list
common options: --verbose --test --help --usage --version --keep-missing
--altdir <directory> --admindir <directory>
[root@britney java]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/jre/bin/java)
2 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.141-2.6.10.1.el7_3.x86_64/jre/bin/java)
Enter to keep the current selection[+], or type selection number: ^C