Java sun primary

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

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

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

14. Show if Java Packages are Installed from openSUSE ...                   

Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*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,

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?

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


ls /var/lib/rpm/alternatives/*java*

which gives for example


/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

@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:

rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*java-*'

Show us what you got installed and tell us again why you are having a problem using Java.

Thank You,

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?


su -
zypper in java-1_6_0-sun java-1_6_0-sun-plugin

if you want to also develop in java use instead


su -
zypper in java-1_6_0-sun java-1_6_0-sun-plugin java-1_6_0-sun-devel

after that


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

thanks,i ll do that and i will post if everything went ok.