Instalando Java

Objetivo

Descrever os procedimentos necessários para instalação Java.

Público-alvo

Destinado aos administradores do OpMon e as equipes de TI que após realizar a instalação do OpMon, necessitam instalar Java.

Solução

1) Verificando versões antigas

Para verificar se já existe:

[root@opmon ~]# rpm -qa | grep java
glib-java-0.2.6-3.fc6
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

Nesse caso, existe uma versão não compatível, é necessário remover.

[root@opmon ~]# rpm -e glib-java-0.2.6-3.fc6 java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

2) Procedimentos de instalação

Proceda com a instalação via yum

[root@opmon ~]# yum install java -y
Loaded plugins:: dellsysid, downloadonly, fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
  * addons: centos.ufms.br
  * base: centos.pop.com.br
  * extras: centos.pop.com.br
  * updates: centos.pop.com.br
OpMon-base                                               |  951  B
OpMon-extras                                             |  951  B
addons                                                   |  951  B
base                                                     |  1.1 KB
extras                                                   |  2.1 KB
updates                                                  |  1.9 KB
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package java-1.6.0-openjdk.i386 1:1.6.0.0-1.22.1.9.8.e15_6 set to be updated
--> Processing Dependency: libgif.so.4 for package: java-1.6.0-openjdk
--> Processing Dependency: tzdata-java for package: java-1.6.0-openjdk
--> Running transaction check
---> Package giflib.i386 0:4.1.3-7.3.3.e15 set to be updated
---> Package tzdata-java.i386 0:2011g-1.e15 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================
Package                  Arch        Version           Repository
================================================================
Installing:
  java-1.6.0-openjdk     i386  1:1.6.0.0-1.22.1.9.8.e15_6   updates
Installing for dependencies:
  giflib                 i386  4.1.3-7.3.3.e15              updates
  tzdata-java            i386    2011g-1.e15                updates
Transaction Summary
==================================================================
Install             3 Package (s)
Upgrade             0 Package (s)
Total download size: 38 M
Is this ok [y/N]: y
Downloading Packages
(1/3) : giflib-4.1.3-7.3.3.e15.i386.rpm                      |  39 KB
(2/3) : tzdata-java-2011g-1.e15.i386.rpm                     | 180 KB
(3/3) : java-1.6.0-openjdk-1.6.0.0-1.22.1.9.8.e15_6.i386.rpm  |  38 KB
-----------------------------------------------------------------------
Total                                               8.2 MB/s  |  38  KB
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction test Succeeded
Running Transaction
   Installing      :  tzdata-java
   Installing      :  giflib
   Installing      :  java-1.6.0-openjdk
Installed:
   java-1.6.0-openjdk.i386  1:1.6.0.0-1.22.1.9.8.e15_6
Dependency Installed:
   giflib.i386  0:4.1.3-7.3.3.e15         tzdata-java.i386   0:2011g-1.e15
Complete!

3) Testando

Para testar a versão:

[root@opmon ~]# java-version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.8)  (rhel-1.22.1.9.8.e15_6-i386)
OpenJDK Server VM (build 19.0-b09, mixed mode)
Updated on dezembro 23, 2016

Was this article helpful?