Novell Home

Upgrading to Java 1.5.x in SLED 10

Novell Cool Solutions: Tip
By Peter McCrackan

Digg This - Slashdot This

Posted: 6 Dec 2006
 

Problem:

SLED10 comes with Java 1.4, this is getting quite "old hat" now. An upgrade to 1.5.x is useful.

If you follow the steps outlined below you should have a problem free upgrade.

Solution:

  1. Go to this web page to find your update: http://java.sun.com/javase/downloads/index.jsp then select your download. If you do not know which one to pick, you probably do not need any developer tools etc so just go with the Java Runtime Environment. For this article I will assume jdk-1_5_0_09-linux-i586.bin as your download file.


  2. Download your update, you will need to accept a license agreement first, then select the type of file you want. I normally use the Linux Self Extracting file, the one that ends with 586.bin


  3. Once downloaded, you will need to make the file executable, do this by opening up a terminal window, change to your download directory and type in chmod u+x jdk-1_5_0_09-linux-i586.bin. Of course you can cheat and just open up a nautilus window, browse to your directory, right click on the file, select Properties, then select the Permissions tab and simply click in the executable box for Owner.


  4. Install your Java update by typing ./jdk-1_5_0_09-linux-i586.bin at the terminal, you do not need to type the whole thing, just type ./ then the first 2 or 3 letters of the file name and press tab, so long as you do not have a file with same first 2 or 3 letters your java update file will be automatically filled in. Press enter and let it do it's stuff. You will need to agree to another license agreement, press space to scroll through the agreement quickly.


  5. Now, staying in the same directory, you will a have directory named whatever your java update was , ie: jdk1.5.0_09 You need to move this directory to the /usr/lib/ directory, do this by becoming root in the terminal, type su then enter your password as prompted. Now you have permission to put stuff into the /usr directory, so ensure you are in the directory where your new java update is and type:

    mv jdk1.5.0_09 /usr/lib
    If you want to do the move within Nautilus then type this from the terminal gnomesu nautilus and a box will pop up requesting your root password, enter that and your Nautilus session is as root user, you can then cut & paste etc to your hearts content.

    Your new Java driectory should now be in /usr/lib/

  6. Update your Firefox plugin? While you have your Nautilus window open as root, you can browse to the plugin directory, in my case this is:
    /usr/lib/jdk1.5.0_09/jre/plugin/i386/ns7/ 
    and the file is called
    libjavaplugin_oji.so
    If you right click on the file and select
    make link 
    it will create a file called:
    link to libjavaplugin_oji.so 
    Select the link you have made and move it into the /usr/lib/firefox/plugins directory, then you can remove the "link to" from it's name so it is called:
    libjavaplugin_oji.so 
    It will have a little arrow on it's icon indicating that it is a link.


  7. You can test your plugin by browsing to this web site: http://java.com/en/index.jsp and selecting Verify Installation, if all has gone well, you should receive a message of congratulations. I guess if you don't get this message then all you can do is review what you have done and try to see what has gone wrong.


  8. Finally, to get this new version of Java into your system as the default version, place this text, but substitute your directory name:
    PATH=/usr/lib/jdk1.5.0_09/bin:$PATH;export PATH
    CLASSPATH=.;export CLASSPATH
    into one or both of these files /home/yourusername/.bashrc 
    /home/yourusername/.profile

You will need to log off and on again to "reset" these files.

A test you can do from within your terminal is type:

java -verison

This will tell you your default version of Java.

That's it, you should be done now. If you have a "jar" file that you want to open (a java executable) you may have to point it to java first by right clicking the file and select open with other application.

Select: use a custom command

Type in:

java -jar

Your computer will remember that from now on.

Hopefully that has covered most of the points you will need in updating your Java.

Environment:

This article is assuming a default installation of SLED10


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell