PURPOSE: TO UNINSTALL OPENJDK AND INSTALL JDK with Fedora 16 & others
*********** STEP 1 STARTS ***********
==:> remove open jdk <: span="">
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.
***********STEP 1 ENDS ***********
*********** STEP 2 STARTS ***********
==:> install jdk on fedora <: span="">
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/
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/
## 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 <: span="">
vi ~/.bash_profile
export JAVA_HOME=/usr/java/jdk1.5.0_
export PATH=$PATH:/usr/java/jdk1.5.0_
$ 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_
export PATH=$PATH:/usr/java/jdk1.5.0_
Save and close the file. Once again you need to type the following command to activate the path settings immediately:
# source /etc/profile
No comments:
Post a Comment