PURPOSE: TO UNINSTALL OPENJDK AND INSTALL JDK
*********** STEP 1 STARTS ***********
==:> remove open jdk <: br="br">
1) to find installed java packages: rpm -qa | grep java
2) to uninstall open jdk : yum remove java-1.6.0-openjdk-1.6.0.0-68.1.11.5.fc16.x86_64
***********STEP 1 ENDS ***********
*********** STEP 2 STARTS ***********
==:> install jdk on fedora <: br="br">
rpm -Uvh /jdk-7u9-linux-x64.rpm
rpm -Uvh /jre-7u9-linux-x64.rpm
## java ##
alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/jre/lib/amd64/libnpjp2.so 20000
## Install javac only if you installed JDK (Java Development Kit) package ##
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000
alternatives --config java
Enter to keep the current selection[+], or type selection number:
Note: java with [+] is currently on use
alternatives --config javaws
alternatives --config libjavaplugin.so
alternatives --config libjavaplugin.so.x86_64
alternatives --config javac
*********** STEP 2 STARTS ***********
*********** STEP 3 STARTS ***********
==:> set classpath in fedora <: br="br">
vi ~/.bash_profile
export JAVA_HOME=/usr/java/jdk1.5.0_07/bin
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
$ source ~/.bash_profile or . ~/.bash_profile
** * Set JAVA_HOME / PATH for all user
You need to setup global config in /etc/profile OR /etc/bash.bashrc file for all users:
# vi /etc/profile
Next setup PATH / JAVA_PATH variables as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
Save and close the file. Once again you need to type the following command to activate the path settings immediately:
# source /etc/profile
*********** STEP 3 STARTS ***********
reference links:
http://fedorasolved.org/Members/zcat/using-sun-java-instead-of-openjdk
http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment