Personally, I like using this directory when I installing new software, so that it is easier to locate and and easier to access.
- Download JDK from Sun Microsystems website. please ensure that you download the Linux Self-Extracting File
- As I used Firefox to download JDK, it automatically downloaded the JDK on my desktop. So I need to move it to /opt/ as it is the directory where I want to install JDK. to do this, log in as root and type the following command mv jdk-1_5_0_09-linux-i586.bin /opt/ && cd /opt/ which will move your download to /opt/ and change your current directory to /opt/
- Execute the following command chmod a+x jdk-1_5_0_09-linux-i586.bin which will make the downloaded file executable.
- Type ./jdk-1_5_0_09-linux-i586.bin to start the extraction process. You will be prompted with a Sun Microsystem licensce agree etc...to continue to the next page of the agreement, hit the return key until prompted to accept the agreement, answer yes to accept the agreement.
- You should now have a directory /opt/jdk1.5.0_09 which contains the JDK and JRE.
- To make things easier for us when we want to set the path to jdk, we will create a symbolic link by issuing the following command ln -s /opt/jdk1.5.0_09 jdk
- Type cd and hit enter just to make sure that you are in your home directory.
- Type gedit .bash_profile & and hit enter. This will open .bash_profile in gedit so that we can easily edit the file and add additional system environment variables.
- Assuming that you have followed the steps above, just before the PATH variable declaration, type JAVA_HOME=/opt/jdk this will set the home directory of where we have installed JDK on our system.
- Add the following line after the JAVA_HOME variable declarations export JAVA_HOME
- Finally, alter the PATH variable so it looks like the following declaration PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
Once you have logged in again, open your shell and type java -version to see if you have been successful in installing JDK on your FC6. You should see something like the following:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing)
That concludes this tutorial. If you have any problems, please contact me and will do my best to help.
All the best.
2 comments:
Thanks a lot. I have followed your instructions and installed Sun java in fedora core 5. wondering about upgrading to fedora 6, but concerned about loosing data. Any chance of given a tutorial on how to Upgrade? thanks
Personally, I did a fresh install. I initially installed Fedora Core 6 on a VMWare station...just to see if everything would go smoothly. Once I managed to install it...I did a fresh install.
I found this tutorial which demonstrates how you might be able to upgrade. Though, I would recommend that you back up your data before you do anything.
http://www.brandonhutchinson.com/Upgrading_Red_Hat_Linux_with_yum.html
good luck.
Post a Comment