Unable to access java files after downloading Oracle Java 7

Hi Team,  

   Just a quick question on how to have my Centos 6.4 have its java version repointed from the basic OpenJDK to the Oracle version.

After installing  jdk 7  ( I got the jdk-7u55-linux-i586.rpm.) from the oracle web site, I did this...

export JAVA_HOME
export PATH

--------------then updated the symbolic links ------------------

update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.7.0_55/bin/java" 1

update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.7.0_45/bin/java" 1
update-alternatives --set java /usr/java/jdk1.7.0_45/bin/java

update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk1.7.0_45/bin/javac" 1
update-alternatives --set javac /usr/java/jdk1.7.0_45/bin/javac

[root@neo4j au123456]# echo $PATH
[root@neo4j au123456]# java -version
bash: java: command not found

---------------------------  I looked for all references of java on my file system --------------
[root@neo4j au123456]# find / -name java
[root@neo4j au123456]# java -version
bash: java: command not found
[root@neo4j au123456]# 
[root@neo4j au123456]# 

Open in new window

* To make java -version work I had to do this:

[root@neo4j au123456]# cd /usr/java/jdk1.7.0_55/bin
[root@neo4j bin]# pwd
[root@neo4j bin]# java -version
bash: java: command not found

[root@neo4j bin]# ./java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing)
[root@neo4j bin]# 

Open in new window

It's like the java executables are not in the path.  I think I am missing something simple, just can't quite figure out what it is.

Thanks in advance for the help.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Seth SimmonsConnect With a Mentor Sr. Systems AdministratorCommented:
your path is wrong; you specify 1.7.0_45 for JAVA_HOME but you have 1.7.0_55 for the path
rleyba828Author Commented:
You are absolutely right.   that's what I get for working at 1:30 in the morning.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.