Below are the steps for installing Java on Fedora.

1. Download latest JDK set-up file (e.g. jdk-6u22-linux-i586.bin) from

2. Copy the file “jdk-6u22-linux-i586.bin” at desired location e.g. “/opt/”
3. Move in to directrory where set-up file has been copied e.g.”/opt/”
#cd /opt/
3. Run the set-up file
4. Now new directory may have been created with name “jdk1.6.0_22” in current directory .
Now you can remove JDK set-up file from current location e.g. “/opt/”.
#rm -rf /opt/jdk-6u22-linux-i586.bin

1. Open the “.bashrc” file to set-up the JAVA path
#vim ~/.bashrc
2. Add the following lines at the bottom of the file.
export PATH=$PATH:.:/opt/jdk1.6.0_22/bin/
In above path, “/opt/jdk1.6.0_22/bin/” is the fully qulified path of “bin/” directory in “jdk1.6.0_22/” directory.
export JAVA_HOME=/opt/jdk1.6.0_22/
In above path, “/opt/jdk1.6.0_22/” is the fully qulified path of “jdk1.6.0_22/” directory.
3. To effect the modification system wide run following command
#source ~/.bashrc
4. Now you can test java set-up by running following command.
#java -version
You may get the output as follows
java version “1.6.0_22″
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

Post By Dinesh (18 Posts)