Results 1 to 10 of 10

Thread: how to install an older version of java?

  1. #1

    Question how to install an older version of java?

    Hi,

    I'm using Open suse 11.0. When I installed it, I chose all the software packages and it installed Java_1.6_0 as a part of it.
    Now I would like to install Java_1.5_x (as the code that I am trying to run hasn't yet been tested in 6.0). I've downloaded the rpm.bin file and have installed it as mentioned in the documentation.
    However, when I do a 'java -version' in the command prompt, it shows 1.6_0. It seems like linux won't let me install an older version without uninstalling the later version.

    Can anyone help in going about this? If there is a work around to uninstalling, please let me know that as well.

    Thanks,

    Soubhik

    PS: I had set the $JAVA_HOME variable to a version 5.0x but the code gave an error because it didn't point to 6.0x, the currently installed version. So I had to change it.

  2. #2
    ab@novell.com NNTP User

    Default Re: how to install an older version of java?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    JAVA_HOME doesn't really matter much when it comes to executables....
    when you run 'java -version' all that matters is where the system finds
    'java' which is in $PATH so update PATH as the following:

    export PATH=/path/to/your/new/jvm/bin:$PATH
    java -version

    And that should show your new (old) version properly.

    Good luck.






    effikc wrote:
    > Hi,
    >
    > I'm using Open suse 11.0. When I installed it, I chose all the software
    > packages and it installed Java_1.6_0 as a part of it.
    > Now I would like to install Java_1.5_x (as the code that I am trying to
    > run hasn't yet been tested in 6.0). I've downloaded the rpm.bin file and
    > have installed it as mentioned in the documentation.
    > However, when I do a 'java -version' in the command prompt, it shows
    > 1.6_0. It seems like linux won't let me install an older version
    > without uninstalling the later version.
    >
    > Can anyone help in going about this? If there is a work around to
    > uninstalling, please let me know that as well.
    >
    > Thanks,
    >
    > Soubhik
    >
    > PS: I had set the $JAVA_HOME variable to a version 5.0x but the code
    > gave an error because it didn't point to 6.0x, the currently installed
    > version. So I had to change it.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIo0Ck3s42bA80+9kRAjOhAJ9lMk8v/IBYtVJVqstXXBvBddneUACfevuT
    M1oXyXuxLZMb78o/h6LCaYM=
    =dwbO
    -----END PGP SIGNATURE-----

  3. #3

    Default Re: how to install an older version of java?

    From Yast, you should be able
    to select an older package by
    searching for java while in the
    "installed," section. Lower
    bottom right corner has the
    version number currently installed.
    Click there, and there SHOULD
    be older versions available.
    It SHOULD also warn you about dependencies if any...

    Hope this helps!

  4. #4

    Default Re: how to install an older version of java?

    the java binaries are actually installed with their version number postfixed to them (ex. java-X.x or something like that). the 'java' command is a symbolic link to the most current java installed. YAST/rpm handle keeping this link up to date. The easy way to run an older version of java is to call it directly. I'm at work right now and don't have access to SUSE but here is how you can find it:

    -do a 'which java' command to find out where the symbolic link is located
    -change directory to that location and do a 'll | grep java'
    -the java command should have an '->' next to it that points the location of the binary it's linked to.
    -The java binaries should all be installed in the same directory, so go to the directory that you found from above and look for 'java1.5' or something like that.

    Good luck!
    openSUSE 11.0

    Tried many distros and I just keep coming back to my venerable SUSE!

  5. #5
    Join Date
    Jun 2008
    Location
    Sarasota
    Posts
    301

    Default Re: how to install an older version of java?

    No, keep them both installed.

    This seems to be a relatively well-kept secret. 'su' to root and type:

    update-alternatives --config java

    It's designed to allow you to have multiple editions, just as you want,
    and to easily switch to whichever version you want to use.

    [Of course, it works for stuff beside just java. See 'man update-alternatives'
    for the gory details.]
    Box1: MEPIS-8.5/sidux/openSUSE-11.3M6(broken-wifi/hiddenSSIDs)/XP(32-bit), nvidia 5200
    Lap1: antiX-8.5(KDE4.4.3)/MEPIS-8.5/Vista, Intel 945GM, builtin-wifi->Broadcom-4311(drv=wl)

  6. #6

    Default Re: how to install an older version of java?

    Quote Originally Posted by CRC123 View Post
    -The java binaries should all be installed in the same directory, so go to the directory that you found from above and look for 'java1.5' or something like that.

    Good luck!
    Just got home, instead of looking for java1.5 etc, look for 'jre-1.5.0' sorry about that.
    openSUSE 11.0

    Tried many distros and I just keep coming back to my venerable SUSE!

  7. #7

    Thumbs up Re: how to install an older version of java?

    Thanks to every body who replied to my question. However, this solution seemed to be the simplest and I tried it. And it worked. (Well at least it is showing the correct version of JAVA that I want).

    [QUOTE=ab@novell.com;1856214]-----BEGIN PGP SIGNED MESSAGE-----

    when you run 'java -version' all that matters is where the system finds
    'java' which is in $PATH so update PATH as the following:

    export PATH=/path/to/your/new/jvm/bin:$PATH
    java -version

  8. #8

    Default Re: how to install an older version of java?

    However a question which still remains.
    Do I need to run the export command every time I start a new xterm window? Or is the change to this version of JAVA permanent?

  9. #9

    Default Re: how to install an older version of java?

    Quote Originally Posted by ajmctaggart View Post
    From Yast, you should be able
    to select an older package by
    searching for java while in the
    "installed," section. Lower
    bottom right corner has the
    version number currently installed.
    Click there, and there SHOULD
    be older versions available.
    It SHOULD also warn you about dependencies if any...

    Hope this helps!
    Yes..I can see the java version I want under jdk. But how do I install it to make it the default version?

  10. #10
    Join Date
    Jun 2008
    Location
    Sarasota
    Posts
    301

    Default Re: how to install an older version of java?

    Quote Originally Posted by effikc View Post
    Yes..I can see the java version I want under jdk. But how do I install it to make it the default version?
    Try doing the 'update-alternatives' that I showed above and
    then choose it's number, even if there is only one choice!

    That should make it operational. And it should set up all necessary
    environment variables, including JAVA_HOME. Don't set that yourself.
    Box1: MEPIS-8.5/sidux/openSUSE-11.3M6(broken-wifi/hiddenSSIDs)/XP(32-bit), nvidia 5200
    Lap1: antiX-8.5(KDE4.4.3)/MEPIS-8.5/Vista, Intel 945GM, builtin-wifi->Broadcom-4311(drv=wl)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •