lunes, 13 de julio de 2015

Instalación de Oracle/JAVA en Centos


1.- Descargar jdk del sitio de oracle:


# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz"



2.- Descompactar

# tar xzf jdk-8u45-linux-x64.tar.gz

3.- Instalarlo con "alternatives"


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


There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /opt/jdk1.7.0_71/bin/java
 + 2           /opt/jdk1.8.0_25/bin/java
   3           /opt/jdk1.8.0_45/bin/java

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



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



4.- Exportar las variables de entorno

# export JAVA_HOME=/opt/jdk1.8.0_45
# export JRE_HOME=/opt/jdk1.8.0_45/jre
# export PATH=$PATH:/opt/jdk1.8.0_45/bin:/opt/jdk1.8.0_45/jre/bin

5.- Verificar la versión instalada


# java -version


java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)



Fuente:

TecAdmin.net

No hay comentarios: