Installing JDK

Issues related to applications and software problems
Post Reply
solo85
Posts: 4
Joined: 2017/06/27 03:10:49
Contact:

Installing JDK

Post by solo85 » 2017/06/27 03:18:34

Hello.

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
Why are there to Java? And should there not be my Oracle Java that I downloaded and installed?
Greetings from the cold norths of Scandinavia! Always stay cool! Website: nettport.com

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Installing JDK

Post by TrevorH » 2017/06/27 08:29:16

Don't use the tar file, use their rpm. yum install /path/to/jdk-8u131-linux-x64.rpm
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Installing JDK

Post by hunter86_bg » 2017/06/29 21:22:28

It should be like this:

Code: Select all

alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_131/bin/java 2

Post Reply