Results 1 to 10 of 10

Thread: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

  1. #1

    Default Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    I want to try the openJDK jre 1.7 but only for one program and use 1.6 for everything else (and as the default).

    1. Where do I find the openJDK 1.7 JRE? (it's not showing up in software management)

    2. How do I ensure when it's installed that it doesn't override the paths that point to the 1.6 jre?

  2. #2

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by 6tr6tr View Post
    I want to try the openJDK jre 1.7 but only for one program and use 1.6 for everything else (and as the default).

    1. Where do I find the openJDK 1.7 JRE? (it's not showing up in software management)

    2. How do I ensure when it's installed that it doesn't override the paths that point to the 1.6 jre?
    [opensuse-factory] OpenJDK7 is going to Factory
    Index of /repositories/Java:/openjdk6:/Factory/openSUSE_12.1

    And I guess update-alternatives is used to select the default version.

  3. #3

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by RedDwarf View Post
    [opensuse-factory] OpenJDK7 is going to Factory
    Index of /repositories/Java:/openjdk6:/Factory/openSUSE_12.1

    And I guess update-alternatives is used to select the default version.
    Thanks. Can you elaborate on what "update-alternatives" is and how to use it to install this the way I want?

    Also, what URL do I use to add this repo?

  4. #4

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by 6tr6tr View Post
    Thanks. Can you elaborate on what "update-alternatives" is and how to use it to install this the way I want?

    Also, what URL do I use to add this repo?
    It doesn't play a part in the installation of the software (that's up to you to do) per se. It's a command line utility that, for some items, allows you to switch/set the app you want the system to use by default. It should be installed by default on your system IIRC. For more info, read the output of "man update-alternatives".

    As an example:
    Code:
    update-alternatives --config java
    will allow you to switch between installed versions as the system default java to run.

    As you are intending to only use one app with 1.7, if that particular app allows you to config the path to the java version you want to use (and is also cognizant of the respective java environment variables), then you won't even need to be switching back and forth via update-alternatives.

  5. #5

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by Tyler_K View Post
    It doesn't play a part in the installation of the software (that's up to you to do) per se. It's a command line utility that, for some items, allows you to switch/set the app you want the system to use by default. It should be installed by default on your system IIRC. For more info, read the output of "man update-alternatives".

    As an example:
    Code:
    update-alternatives --config java
    will allow you to switch between installed versions as the system default java to run.

    As you are intending to only use one app with 1.7, if that particular app allows you to config the path to the java version you want to use (and is also cognizant of the respective java environment variables), then you won't even need to be switching back and forth via update-alternatives.
    Thanks, two questions:

    1. What URL do I use to add the repo?

    2. How do I install only the JRE? (Looking at the links, I find only full sdk install options)

  6. #6

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by 6tr6tr View Post
    Thanks, two questions:

    1. What URL do I use to add the repo?
    As provided by RedDwarf above: Index of /repositories/Java:/openjdk6:/Factory/openSUSE_12.1

    2. How do I install only the JRE? (Looking at the links, I find only full sdk install options)
    there are separate downloads the jre and sdk. Not sure what you are looking at or missing.

  7. #7

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by Tyler_K View Post
    As provided by RedDwarf above: Index of /repositories/Java:/openjdk6:/Factory/openSUSE_12.1

    there are separate downloads the jre and sdk. Not sure what you are looking at or missing.
    Thanks I installed that but now (as I did not want) JRE 1.7 has replaced 1.6 (even though both are installed) When I type "java -version" on the command line it saya 1.7. How do I get 1.6 back?

    EDIT: What's weird is I have a file "/usr/bin/java" but that file is NOT in the "file list" of any of the packages!

  8. #8

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    When I try using update-alternatives, it doesn't work:

    Code:
    sudo /usr/sbin/update-alternatives --install "/usr/bin/java" "java" "/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin/java" 1
    update-alternatives: warning: forcing reinstallation of alternative /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java because link group java is broken.
    update-alternatives: warning: not replacing /usr/share/applications/policytool.desktop with a link.

  9. #9

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by 6tr6tr View Post
    When I try using update-alternatives, it doesn't work:

    Code:
    sudo /usr/sbin/update-alternatives --install "/usr/bin/java" "java" "/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin/java" 1
    update-alternatives: warning: forcing reinstallation of alternative /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java because link group java is broken.
    update-alternatives: warning: not replacing /usr/share/applications/policytool.desktop with a link.
    I solved this by using "sudo update-alternatives --config java", which then showed me the following choices:
    Code:
      Selection    Path                                                  Priority   Status
    ------------------------------------------------------------
    * 0            /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java              17147     auto mode
      1            /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin/java   1         manual mode
      2            /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java              17105     manual mode                                                                                                                                                                                
      3            /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java              17147     manual mode
    I'm guessing the "1" choice was just created by me. I see that the path it expects is "/usr/lib64/jvm/jre-..." not "/usr/lib64/jvm/java..." even though the latter is what exists in the file list in Software Management for the packages. How confusing and unclear!

  10. #10

    Default Re: Installing openJDK JRE 1.7 alongside openJDK SDK 1.6?

    Quote Originally Posted by 6tr6tr View Post
    Thanks I installed that but now (as I did not want) JRE 1.7 has replaced 1.6 (even though both are installed) When I type "java -version" on the command line it saya 1.7. How do I get 1.6 back?
    I see further on in the thread you discovered the wonders of update-alternatives

    EDIT: What's weird is I have a file "/usr/bin/java" but that file is NOT in the "file list" of any of the packages!
    /usr/bin/java is just a symbolic link ... in your file manager, dolphin for example, right click on the file and select properties, and it should display the target ... for me, that happens to be /etc/alternatives/java ... which is, itself, a smybolic link that points to .... eventually going down the garden path you get to the actual java app.

Posting Permissions

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