how to install sun java?

I have openjdk installed in my system but i want sun’s jdk in my system. I have installed sun java but all programs think that i have openjdk (including eclipse and firefox) i managed to link the sun’s jre plugin (browser ns7 plugin) in the browser plugins directory in /usr/lib/browser-plugin and now firefox finds the latest java plugin, but how do i tell eclipse and other programs to see the /usr/java/jdk1.6.0_12 ?

I am trying to use qt-integration plugin in eclicpse and it crashes as soon as I try to open the .ui file. the log shows that openjvm has crashed . how do i set the (links???) or paths so that every program see the recently installed (/usr/java/jdk1.6.0_12 and its jre ) instead of IcedTea and openjdk??

please, any pointers and/or help will be awsome.

What if you remove IcedTea and openjdk?

I think you have two options. One is to uninstall openjdk, since you already have the Sun java, this what I would do.

If you want to have both, I believe the program

update-alternatives --auto

( must be run as root), will reset all the links.

Good luck

thank you so much…

I am trying to uninstall the openJdk, and see what happens… BTW, the update-alternatives --auto did not do the trick. I guess it does but i am not good enough to know that (:P). I guess i need to add path in the commands??? (for every files there?)

First of all, please note that you don’t have to mess with things like file paths etc.
Just make sure that you have installed everything from the DVD (and/or updated from repositories).
In order to switch between different Java (JRE) versions, just type: (as root)


update-alternatives --config java

In order to switch between different Java compilers:


update-alternatives --config javac

Ok, while doing “update-alternatives --config java”, it only shows the java installed by the yast only. I have installed java from sun (1.6.12) in /usr/java/ which is not shown there.

How can i use it?

Really, searching the forums helps a lot :wink:

help installing jre-6u12-linux-i586-rpm.bin. - openSUSE Forums

This is how to install the latest java from YAST and from the .rpm from SUN and how to get either installation working with firefox.

Hope this helps!

sorry,

running

update-alternatives --config java

again solved the problem… :slight_smile:

what is the command to uninstall openjdk and gjc

i am very new, and what does the + mean… the program i am trying to use only works with sun java

linux-39ey:/home/phillip # update-alternatives --config java

There are 3 alternatives which provide `java’.

Selection Alternative

  •    1    /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java
       2    /usr/lib64/jvm/jre-1.5.0-gcj/bin/java
    
  •     3    /usr/lib64/jvm/jre-1.6.0-sun/bin/java
    

Press enter to keep the default[li], or type selection number: 3[/li]Using ‘/usr/lib64/jvm/jre-1.6.0-sun/bin/java’ to provide ‘java’.

  • is the default selection… + is the one you selected.