Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32

Thread: How to install JRE/JDK in 12.2?

  1. #1

    Question How to install JRE/JDK in 12.2?

    I need to install the official Oracle JRE (so I can install CrashPlan, which has issues with OpenJDK), but the docs seem to be out of date for 12.2. I did have a go at that guide anyway but ran into a brick wall, so I guess it wasn't such a good idea.

    I need the JRE now but eventually would like to install the JDK so I can get into some development with Eclipse.

    Thanks.

    (just switched from Debian Wheezy, so please forgive me if I'm asking something that's obvious)

  2. #2
    dd@home.dk NNTP User

    Default Re: How to install JRE/JDK in 12.2?

    On 09/11/2012 12:26 PM, marcfearby wrote:

    > (just switched from Debian Wheezy, so please forgive me if I'm asking
    > something that's obvious)


    we -=WELCOME=- new posting switchers too! (lots of little differences
    all over...proceed carefully)

    it is not so obvious..

    i recently installed SUN Java 1.7.something using the info here
    http://forums.opensuse.org/showthread.php?t=467910
    which pointed me to this page
    http://sites.google.com/site/easylin...a-for-opensuse
    and gave instructions that demand you pay close attention....don't skip
    any steps...

    it worked here, it may not work for 12.2

    please let us know if it does, or not..

    --
    dd http://goo.gl/PUjnL
    http://tinyurl.com/DD-Caveat

  3. #3

    Default Re: How to install JRE/JDK in 12.2?

    So I have a script I've written which Ive used from I think OpenSuse 11.3 (haven't run it 12.2 but it works on 12.1). I do like having the openjdk installed so I can play around and see differences. So I let yast take care of updating that, but for my everyday life I generally prefer or absolutely need to the sun/oracle jdk. Because of this everytime the openjdk installs it relinks the java commands in /usr/bin to itself. This script simply removes those and replaces them to where ever the version of java you want is.

    Code:
    #!/usr/bin/sh
    JAVA=/usr/java6
    echo "Java Home: $JAVA"
    echo -e "Change Links [y|n]: \c "
    read res
    array=( java javac javadoc javah javap javaws jar jarsigner)
    plugins=( libnpjp2.so javaplugin.so )
    if [ "$res" == "y" -o "$res" == "Y" ]; then
            echo "Removing Links"
            echo "=============="
            for i in "${array[@]}"
            do
                    rm /usr/bin/$i
                    echo "Removed /usr/bin/$i"
            done
            echo "Removing Plugins"
            echo "================"
            for i in "${plugins[@]}"
            do
                    rm /usr/lib64/browser-plugins/$i
                    echo "Removed /usr/lib64/browser-plugins/$i"
            done
            echo "Recreating Links"
            echo "================"
            for i in "${array[@]}"
            do
                    ln -s $JAVA/bin/$i /usr/bin/$i
                    echo "Created /usr/bin/$i -> $JAVA/bin/$i"
            done
            echo "Recreating Plugin"
            echo "================="
            ln -s $JAVA/jre/lib/amd64/libnpjp2.so /usr/lib64/browser-plugins/libnpjp2.so
            echo "Created /usr/lib64/browser-plugins/libnpjp2.so -> $JAVA/jre/lib/amd64/libnpjp2.so"
    
    else
            echo "Nothing to do... Good Bye!"
    fi
    So its not fully featured and for the sake of the post I declared the value for $JAVA at the beginning but in my normal use I have JAVA_HOME set in my .bashrc and read that in. This requires root to run, so sudo or run as su (dont have it checking to ensure that). Then it makes sure you really want to link to your new version of java. Its also meant for 64bit, will need to be tweaked to handle the plugins correctly for 32bit.

    But essentially what you do is download and extract java. Then you give this script, so set JAVA to the location of the exploded version of the jdk. And it sets up the symbolic links so that its the default jre/jdk on your system. For me I keep around java 1.5 1.6 and 1.7 along both sun and open versions where available and with this I can easily change what the systems default is.

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,374
    Blog Entries
    1

    Default Re: How to install JRE/JDK in 12.2?

    @baaldemon: Doesn't update-alternatives do that for you?
    Code:
    update-alternatives --config java

  5. #5

    Default Re: How to install JRE/JDK in 12.2?

    Quote Originally Posted by deano_ferrari View Post
    @baaldemon: Doesn't update-alternatives do that for you?
    Code:
    update-alternatives --config java
    Didnt know about that, but it appears to only set it back to the openjdk version thats installed by yast, can you tell it to point to other locations?

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,374
    Blog Entries
    1

    Default Re: How to install JRE/JDK in 12.2?

    Didnt know about that, but it appears to only set it back to the openjdk version thats installed by yast, can you tell it to point to other locations?
    It is outlined in the how to pointed at by DD:

    https://sites.google.com/site/easyli...a-for-opensuse

    In particular

    https://sites.google.com/site/easyli...-make-the-new-

  7. #7

    Default Re: How to install JRE/JDK in 12.2?

    Quote Originally Posted by dd@home.dk View Post
    and gave instructions that demand you pay close attention....don't skip
    any steps..
    I think you're right about the bit above. I read the 64-bit instructions, saw the bit about removing IcedTea completely, so jumped right into YaST and removed anything that looked like java. Well... long story short and trying to figure out why I can't get CrashPlan to work, I try downloading Eclipse to see what it reckoned, and it says the following:

    "GCJ has been detected as the current Java virtual machine. Use of GCJ is untested and unsupported. Please consult the documentation for more"

    I didn't quite get to the bit shortly after the IcedTea reference that said:

    Note: leave openJDK itself installed, otherwise malfunctions may occur!

    So... I'd better go and put OpenJDK back and start again! Java has always been a love/hate relationship... well, more on the hate than the love side, I think. My feeble brain tells me that I shouldn't need OpenJDK if I'm installing the real deal, but life wasn't meant to be this easy. I'll report back if I ever get it working, and thanks for your help.

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to install JRE/JDK in 12.2?

    On 2012-09-11 17:17, dd@home.dk wrote:

    > i recently installed SUN Java 1.7.something using the info here
    > http://forums.opensuse.org/showthread.php?t=467910
    > which pointed me to this page
    > http://sites.google.com/site/easylin...a-for-opensuse
    > and gave instructions that demand you pay close attention....don't skip any steps...


    I personally prefer to install the rpm version of jre, not the tar.gz the howto recommends.
    There are less things to do, and after all, all installed packages are rpm, do not make an
    exception with java.


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to install JRE/JDK in 12.2?

    On 2012-09-12 13:16, marcfearby wrote:
    > I think you're right about the bit above. I read the 64-bit
    > instructions, saw the bit about removing IcedTea completely, so jumped
    > right into YaST and removed anything that looked like java.


    You can not do that, yast will try to install any other version of java and will not recognize
    jre as a java.


    How can we make Yast happy when JRE
    is installed?


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  10. #10

    Red face Re: How to install JRE/JDK in 12.2?

    Quote Originally Posted by robin_listas View Post
    You can not do that, yast will try to install any other version of java and will not recognize jre as a java.
    I still don't get why it goes off and puts in another java when I remove OpenJDK (I thought the FOSS community was slowly but surely giving Java the cold shoulder these days anyway? why is java still so necessary?). Anyway, after putting OpenJDK back and re-installing Java, Eclipse is happy, and so is CrashPlan (though it seems hell bent on forcing me to delete 86GB of backups before transferring the license, which is not good!).

    LibreOffice also complained but its message box told me to what to do so I added /opt/java/64/jre1.7.0_07 to its options window and all's well there, too.

    Thanks everyone for your help :-)

Page 1 of 4 123 ... LastLast

Posting Permissions

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