Results 1 to 9 of 9

Thread: Java sun primary

  1. #1
    Join Date
    Apr 2011
    Location
    Λάρισα
    Posts
    27

    Default Java sun primary

    How can i set java sun primary instead of java jdk without uninstalling the jdk in suse 11.4?
    Hardware:intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz │Ram 2GB │GPU nvidia gedorce 9600Gt Albatron│MB Asus P5K/PEU
    OS:Windows 7, OpenSuse 12.1 (kde, 32 bit)

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: Java sun primary

    hocico0777 wrote:

    >
    > How can i set java sun primary instead of java jdk without uninstalling
    > the jdk in suse 11.4?
    >

    With the command update-alternatives (as root).

    --
    PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.3 | GeForce
    9600 GT | 4GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
    ION | 3GB Ram

  3. #3
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Java sun primary

    To see what java packages you have installed, you can use the following terminal command as shown in the bash script mmcheck:

    Code:
    14. Show if Java Packages are Installed from openSUSE ...                   
    
    Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}\n' '*java-*'
    
    java-1_6_0-sun-alsa-1.6.0.u25-0.3.1-x86_64 -> openSUSE
    java-1_6_0-sun-1.6.0.u25-0.3.1-x86_64 -> openSUSE
    java-1_6_0-sun-plugin-1.6.0.u25-0.3.1-x86_64 -> openSUSE
    
    You should expect to have only Sun Java Packages installed.  If your files 
    include the name --> openjdk <--, it is suggested that they be uninstalled.
    
    Press <enter> to continue...
    If there are any other packages listed than shown above, go to:

    YaST / Software / Software Management and search on Java and UNINSTALL any other Java packages that come up in the search and add the ones shown above if they are missing.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  4. #4
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: Java sun primary

    It is really no true that one has to uninstall the openjdk. Esp. for java
    developers (and I am developing mainly in java in my job) it is often
    essential to have both (sun/oracle and openjdk) on the same machine for
    testing.
    update-alternatives is exactly made for switching the defaults system wide
    and it works well (including changing the java plugin for the browser forth
    and back).

    A bit more explanation from my side.
    If you want to see which configurations can be changed just look at the
    following folder
    Code:
    ls /var/lib/rpm/alternatives/*java*
    which gives for example
    Code:
    /var/lib/rpm/alternatives/java
    /var/lib/rpm/alternatives/java_sdk_1.6.0
    /var/lib/rpm/alternatives/java_sdk_openjdk
    /var/lib/rpm/alternatives/java_sdk_sun
    /var/lib/rpm/alternatives/javac
    /var/lib/rpm/alternatives/javamail_1_3_1_api
    /var/lib/rpm/alternatives/javamail_api
    /var/lib/rpm/alternatives/javaplugin
    The file names listed here are exactly the parameter <name> you can use for
    the update-alternatives --config <name>
    (If you are lazy as I am, just run "update-alternatives --all" and it asks
    step by step all configurations for which there is an alternative).
    The important config names for java are java, java_sdk_1.6.0, javac,
    javaplugin.
    The rest needs no change from the default.

    --
    PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.3 | GeForce
    9600 GT | 4GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
    ION | 3GB Ram

  5. #5
    Join Date
    Apr 2011
    Location
    Λάρισα
    Posts
    27

    Default Απ: Re: Java sun primary

    thanks guys.
    @martin_helm can you tell me exactly what i have to type in the terminal?
    @jdmcdaniel3 is the alsa plugin necessary?Why should i uninstall the jdk packages?
    Hardware:intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz │Ram 2GB │GPU nvidia gedorce 9600Gt Albatron│MB Asus P5K/PEU
    OS:Windows 7, OpenSuse 12.1 (kde, 32 bit)

  6. #6
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Απ: Re: Java sun primary

    @jdmcdaniel3 is the alsa plugin necessary?Why should i uninstall the jdk packages?
    If Java is not working for you then get rid of the jdk packages. Either they work or they do not. I suggest you load the three packages that I have shown, but you are free to experiment with any combination that you like. I have found the following to work just fine. You might run the following terminal command and show us the results just as I did from my computer. Open a terminal session and run the command:

    Code:
    rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}\n' '*java-*'
    Show us what you got installed and tell us again why you are having a problem using Java.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  7. #7
    Join Date
    Apr 2011
    Location
    Λάρισα
    Posts
    27

    Default Απ: Re: Απ: Re: Java sun primary

    I do not have aproblem exactly.In my country (Greece) there is a website from where we can download various stuff.The guys who own the site have made a dowloader (program) based on java i suppose. This program takes the links (eg rapidshare,megaupload etc) and starts to download.If i do not have set the sun java as primary the downloader does not store the links so everytime i open this downloader ihave to find the links again.In cases of a file which has many links this is very inconvenient.

    @martin_helm when i use linux mint i type ''sudo update-java-alternatives -l'' then ''sudo update-alternatives --config java'' and i give the number of the java i want to set primary.
    in suse what exactly i type for the equivalent commands?
    Hardware:intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz │Ram 2GB │GPU nvidia gedorce 9600Gt Albatron│MB Asus P5K/PEU
    OS:Windows 7, OpenSuse 12.1 (kde, 32 bit)

  8. #8
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: Java sun primary

    Code:
    su -
    zypper in java-1_6_0-sun java-1_6_0-sun-plugin
    if you want to also develop in java use instead
    Code:
    su -
    zypper in java-1_6_0-sun java-1_6_0-sun-plugin java-1_6_0-sun-devel
    after that
    Code:
    su -
    update-alternatives --config java
    update-alternatives --config javac
    update-alternatives --config javaplugin
    update-alternatives --config java_sdk_1.6.0
    and choose for every one the option with sun in it. Ready.

    --
    PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.3 | GeForce
    9600 GT | 4GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.0 | nVidia
    ION | 3GB Ram

  9. #9
    Join Date
    Apr 2011
    Location
    Λάρισα
    Posts
    27

    Default Απ: Re: Java sun primary

    thanks,i ll do that and i will post if everything went ok.
    Hardware:intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz │Ram 2GB │GPU nvidia gedorce 9600Gt Albatron│MB Asus P5K/PEU
    OS:Windows 7, OpenSuse 12.1 (kde, 32 bit)

Posting Permissions

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