RHEL 5.7 Java installation

Hi

I am trying to install java jdk-1.7.0_25
 I removed the existing version of java  rm -r jdk1.6.0.27 (deleting file by file) which was installed using self-extracting file.
Than downloaded the jdk-7u25-linux-64.rpm.

Executed the command: rpm –ivh jdk-7u25-linux-x64.rpm
After that:

alternatives --install /usr/bin/java java /usr/java/jdk-1.7.0_25/bin/java 20000
alternatives --install /usr/bin/javac javac /usr/java/jdk-1.7.0_25/bin/javac 20000

After that

alternatives  --config java
alternatives  --config javac

and I set the /usr/java/jdk-1.7.0_25/bin/java as the java version
the same for javac

now when I type: java -version

it returns

java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

The  command: type java
Returns:
java is hashed (/usr/java/jdk1.6.0_27/bin/java)

Could you please help me to solve this problem?

Thank you in advance
alternatives --config java
claud53Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
gheistConnect With a Mentor Commented:
You need to rpm -e whatever java you have on system deleting folder leaves library paths broken.
0
 
claud53Author Commented:
Another thing:
When I type the command rpm -qa jdk
it returns
jdk-1.7.0_25-fcs
this is the correct version.
0
 
claud53Author Commented:
Hi again:

I used the command:
ls -l $(locate libjli.so)

it returns:

-rwxr-xr-x 1 root root 105728 Jun 6 2013 /usr/java/jdk1.7.0_25/jre/lib/amd64/jli/libjli.so
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
savoneCommented:
Why not use yum?

yum list jdk*
0
 
claud53Author Commented:
Because I am using RHEL 5.7 without subscription
0
 
claud53Author Commented:
It expired lately
0
 
savoneCommented:
You are going to run into a lot of problems and dependency hell.  My suggestion to you would be either but a subscription or move to CentOS.
0
 
claud53Author Commented:
As you may understand from my comments I am new to RHEL (and linux).  RHEL 5.7 is not supported anymore according to someone I contacted online. The lowest supported version is 5.11.
If i move to CentOS do I have to the same features. Do I have to be online connected to the internet to use yum
0
 
savoneConnect With a Mentor Commented:
You have all the same features with CentOS.  You do not HAVE to be connected to the internet to use yum, but it makes life a lot easier.
0
 
Seth SimmonsSr. Systems AdministratorCommented:
libjli.so: cannot open shared object file

try this
create this file - /etc/ld.so.conf.d/java.conf
and put in it the path to that library; in this case /usr/java/jdk1.7.0_25/jre/lib/amd64/jli/
then run /sbin/ldconfig as root
0
All Courses

From novice to tech pro — start learning today.