Results 1 to 3 of 3
I am using CentOS flavor
well by using "yum list installed" command
java open jdk 1.6 is installed...
when i type ...java command
it shows some output related to java ...
- 11-12-2011 #1Just Joined!
- Join Date
- May 2010
- Posts
- 5
Java Installation Problem in CentOs Which JAVA
I am using CentOS flavor
well by using "yum list installed" command
java open jdk 1.6 is installed...
when i type ...java command
it shows some output related to java command
it means that java is installed
I downloaded java 1.7 version package(.tar.gz)
and
installed in /usr/bin/java/jdk1.7.0.
and
set the classpath and path files java_home in bashprofile and bashrc
when i run java command i shows the output it simply means java is installed and javac also worked
I succesfully installed the java 1.7 overriding the openjdk1.6
verified by java -version command...
But
when I type comand "which java" command it show the output as /usr/lib/java where the java openjdk 1.6 is installed primiraliy comes with the os
if the older version is overridden the
it should show the output as /usr/bin/java/jdk1.7.10
it means that java 1.6 is not overridden ???
???
??
- 11-12-2011 #2
It can get really messy. Use the 'alternatives' tool to straighten out the Java system, you need to run this from the command line. Check out its man page.
Linux user #126863 - see http://linuxcounter.net/
- 11-12-2011 #3Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Roxoff is right. I've done this so many times I wrote it down. I do something like this:
In the second command, replace with "/usr/bin/java/jdk1.7.0/bin/java" with whatever is the proper path to the java binary.Code:# back up the original java [ -f /usr/bin/java ] && mv /usr/bin/java /usr/bin/java160 # use alternatives command to install links and stuff update-alternatives --install "/usr/bin/java" "java" "/usr/bin/java/jdk1.7.0/bin/java" 1


Reply With Quote