To update java go to the sun java website and download the latest update for Java Runtime Environment (JRE).
http://java.sun.com/javase/downloads/index.jsp
The latest update at the moment is jre-6u2-linux-i586-rpm.bin
Place the file into your home directory.
* To remove your previous version of java if you have one you begin by typing the following into the terminal:
Code:
su
yum list installed|less
* This will list all of your installed rpms. To scroll down to the letter j and look for jre, press enter. My system didn't show 'jre' for whatever reason from the previous update.
* Remove your old java installation with the following command:
* The next step is remove the java link that you previously made for your mozilla plugin. Type the following:
Code:
rm /usr/lib/mozilla/plugins/libjavaplugin_oji.so
* To install your new version of java type the following command:
Code:
su
sh ./jre-6u2-linux-i586-rpm.bin
[Start the installation process, accept agreement]
* Note you have to make changes to jre1.6.0_01 to execute the installation of your next update.
* The next step is to link java to mozilla plugins by using the following commands:
Code:
cd /usr/lib/mozilla/plugins/
ln -s /usr/java/jre1.6.0_02/plugin/i386/ns7/libjavaplugin_oji.so
* When you update java next time you have to change jre1.6.02 to the new filename. You can find this by looking in the usr directory such as /usr/java/jre1.6.0_02. i right click and copy the file and then paste it into bash. This gives me the file name and path.
Very handy!
CLOSE THE TERMINAL
NEXT
* To run Java enabled applications such as the open source frostwire which is much better alternative to limewire for p2p file sharing.
http://www.frostwire.com/
Do the following:
BEWARE it is not recommended to use the
su - command for this instance as it can make a mess of the bash path creating a serious error rendering bash useless. I was never able to fix it. i had to reinstall 3 times until i figured out the 'su -' command was the problem for both my fedora 6 and 7 installations.
Code:
su
gedit /etc/profile.d/java.sh
* Insert the following text into the new file:
Code:
#!/bin/sh
JAVA_HOME=/opt/jre1.6.0_02
export JAVA_HOME
JAVA_BIN=$JAVA_HOME/bin
CLASSPATH=$CLASSPATH:$JAVA_HOME:$JAVA_HOME/lib
PATH=$JAVA_BIN:$PATH
export JAVA_BIN CLASSPATH PATH
*Don't forget to save the edited file with a carriage return. This means that the cursor finishes on a blank line below the last line of text.
* More commands
Code:
source /etc/profile.d/java.sh
/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.6.0_02/bin/java 2
/usr/sbin/alternatives --config java
* Remember to make changes where you see jre1.6.0_02 for your next java update.
* You should see the following screen if it's your first java installation:
There are 2 programs which provide 'java'.
Code:
Selection Command
-----------------------------------------------
* 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
+ 2 /opt/jre1.6.0_02/bin/java
(jre1.6.0_02 is what you want so choose option +2)
(Enter to keep the current selection[+], or type selection number:)
__________________________________________________ _________________
* Type the following command:
Code:
/usr/sbin/alternatives --display java
* You should see following:
Code:
java - status is manual.
link currently points to /opt/jre1.6.0_02/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave keytool: /usr/lib/jvm/jre-1.4.2-gcj/bin/keytool
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
/opt/jre1.5.0_10/bin/java - priority 2
slave keytool: (null)
slave rmiregistry: (null)
slave jre_exports: (null)
slave jre: (null)
/opt/jre1.6.0_02/bin/java - priority 2
slave keytool: (null)
slave rmiregistry: (null)
slave jre_exports: (null)
slave jre: (null)
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.
*You can test your java installation at
http://www.javatester.org/version.html and
http://www.java.com/en/download/installed.jsp
cheers johnny