By Shahram Javey
In Fedora, you’ll need to follow long chain of symbolic links to get to the java
command. Running the command which java
, yields
/usr/bin/java
which is a link to/etc/alternatives/java
which links to/usr/lib/jvm/jre-1.4.2-gcj/bin/java
which links to/usr/bin/gij
.
The default java in Fedora is the GNU java. Changing java to be the latest version of SUN Java is simple. Just follow the instructions below:
- Download the latest JDK for linux (
jdk-6u1-linux-i586-rpm.bin
). sh jdk-6u1-linux-i586-rpm.bin
This will create the RPM file.su
— become rootrpm -Uvh jdk-6u1-linux-i586.rpm
This will install the JDK in/usr/java/
folder.- create the file /etc/profile.d/java.sh with the following content:
export JAVA_HOME=/usr/java/jdk1.6.0_01
export JAVA_PATH=$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATHWhen a user logs in, environment variables are defined & accumulated in the following order:
- /etc/profile (for all users)
- All the files in the /etc/profile.d directory
- Then ~/.bash_profile
- Finally ~/.bashrc
chmod +x /etc/profile.d/java.sh
- log out and log back in. Now when you run the command
java -version
, you’ll see that you’re using the latest version of SUN Java —1.6.0_01
.
Tidak ada komentar:
Posting Komentar