Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Unable to access java files after downloading Oracle Java 7

Posted on 2014-04-17
2
Medium Priority
?
903 Views
Last Modified: 2014-04-17
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...

JAVA_HOME=/usr/java/jdk1.7.0_45
PATH=$PATH:$JAVA_HOME/bin
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
/usr/lib/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/au123456/bin:/usr/java/jdk1.7.0_45/bin
[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
/usr/share/java
/usr/java
/usr/java/jdk1.7.0_55/jre/bin/java
/usr/java/jdk1.7.0_55/bin/java
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/jre/bin/java
/usr/lib/libreoffice/basis3.4/share/Scripts/java
/usr/lib/libreoffice/ure/share/java
/usr/lib/java
/usr/bin/java
/etc/pki/java
/etc/alternatives/java
/etc/java
/var/www/html/xataface-2.0.1/build_tools/jsdoc/java
/var/lib/alternatives/java
/home/au123456/Downloads/xataface-2.0.1/build_tools/jsdoc/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
/usr/java/jdk1.7.0_55/bin
[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.
0
Comment
Question by:rleyba828
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Seth Simmons earned 2000 total points
ID: 40008099
your path is wrong; you specify 1.7.0_45 for JAVA_HOME but you have 1.7.0_55 for the path
0
 

Author Comment

by:rleyba828
ID: 40008121
You are absolutely right.   that's what I get for working at 1:30 in the morning.

thanks
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question