-   Linux - Newbie (
-   -   Red Hat Enterprise Linux Server 5.7 Java installation (

claud53 11-03-2014 05:45 AM

Red Hat Enterprise Linux Server 5.7 Java installation
Dear All,

I am new to RHEL and I need some help to solve a situation I am experiencing. I need to uninstall java version jdk1.7.0_27 and install jre-7u40-linux-x64.rpm.
It seems like the jdk is installed manually by someone else and not using rpm.
When I type: which java the result is: /usr/java/jdk1.6.0_27/bin/java
When I type: rpm –qi jdk the result is: package jdk is not installed.

Can you help me with a step by step guide to uninstall the current jdk and install the new jre using .rpm?

Thank you in advance for your help!

smallpond 11-03-2014 06:01 AM


rpm -qa |grep jdk
It is not uncommon to have multiple versions of java installed on a server.

claud53 11-03-2014 06:02 AM

The command
rpm -qa |grep jdk

returns nothing

claud53 11-03-2014 06:07 AM

I have followed the guide in this and I found that:
ls /usr/java returns
default jdk1.6.0_27 and the file that I copied jre-7u40-linux-x64.rpm with the word latest at the end of the line.
default jdk1.6.0_27 jre-7u40-linux-x64.rpm latest

The command:
ls /opt returns

smallpond 11-03-2014 06:19 AM

The standard java for RHEL is openjdk. Are you sure that you want to install that jre?

If the version of java that you want to remove was installed from source then find the build directory and do

make uninstall

claud53 11-03-2014 06:22 AM

From the above information could you please help to figure out if the java was installed from source and what is the directory? What is the correct command to remove it?

claud53 11-03-2014 06:24 AM

ls /opt returns

ls /usr/java returns
default jdk1.6.0_27 jre-7u40-linux-x64.rpm latest

EDDY1 11-03-2014 08:32 AM

You can use the update alternatives command to use the latest.

John VV 11-03-2014 02:20 PM

this is also the OLD and NOT updated rhel 5.7 !!!
the current java 1.7 rpm will likely not run on the old 5.7

OP can you post the output of this to verify it is 5.7 and NOT the current older legacy 5.11

su -
cat /etc/redhat-release

also seeing as this IS a RedHat server
you DO have the support contract and access to the redhat knowledgebase
the full install instructions ARE in the redhat database

login to the redhat site and search
also you can read the install instructions in the redhat docs

claud53 11-04-2014 03:11 AM

Hi John

The version of RHEL Server I have is 5.7 (Tikanga) and the subscription is expired. Thats why I was asking for help.

I know that the version of java that was installed in my machine by someone else id jdk1.6.0_27 and the location is /usr/java/jdk1.6.0_27/bin/java.

When I try to find the package rpm -qa jdk the system returns nothing.

ls /opt returns

ls /usr/java returns
default jdk1.6.0_27 jre-7u40-linux-x64.rpm latest

Is this a self-extracting package installation or not?

Thank you

timl 11-04-2014 03:33 AM

Hi Claud53,

As JohnVV has pointed out you are using an out of date version of RHEL with no support. Typically there is little point using this release.

Could you tell us your circumstances pls? Like do you have to use this version? It may be that there are other recommendations which could make your life easier. Centos is the free version of RHEL and you can install V7.0 should you desire.


claud53 11-04-2014 08:02 AM

I have to use this version. This is why I am asking for help.

John VV 11-04-2014 12:39 PM

you might be able to get the current 1.6 java .bin to install
( read the install instructions on the Oracle web site)

/opt is a normal install location for manually installed code

but you will need to point software to it's location

i doubt that 1.7 will even run on that old OS , it might ???


jdk1.7.0_27 and install jre-7u40-linux-x64.rpm
forget about using the rpm
it is GOING to error with unsolved DEPENDENCIES
it is for RHEL 6.6 and NOT the old 5.? series

have you searched the redhat knowlagebase ?

login to the redhat site and search
also you can read the install instructions in the redhat docs

the install instructions ARE there for using the bin file
you have to login to the redhat site with the credentials you set up when you BOUGHT!!!
the REQUIRED!!! support contract !!!

one of the issues is java is GOING!!!!!!! to NEED some fonts installed
and they ARE IN THE REDHAT REPO!!!!!!
and to install them you NEED the required support contract from redhat

install the free alternative
but again 5.7 is and HAS been unsupported
5.11 is the current version

claud53 11-04-2014 01:38 PM

According to the Java 7 System Requirements Redh Hat supports it.
Are you sure that it isn't supported?


Oracle Linux 5.5+
Oracle Linux 6.x (32-bit), 6.x (64-bit)3
Oracle Linux 7.x (64-bit)3
Red Hat Enterprise Linux 5.5+, 6.x (32-bit), 6.x (64-bit)3
Ubuntu Linux 10.04 and above
Suse Linux Enterprise Server 10 SP2, 11.x
Browsers: Firefox 3.6 and above

John VV 11-04-2014 03:41 PM

fallow step 3 in the cent wiki
3.2. Java for the developer and the server environment
you must have the required redhat support contract to install any needed things

and see the 1.7 warning for the older legacy 5 systems

your best bet is to install a supported operathing system
then use the already installed "icedtea" version of java

All times are GMT -5. The time now is 04:46 PM.