Manually installation of Java recognition in Yast.

How do I get YAST to recognize a manually installed Java installation?
I have installed the rpm-bin package of JDK-1.6u33 from Sun/Oracle. This installation is visible in YAST, but when upgrading LibreOffice it complains about a missing Java dependency and wants to install openJDK(which I have locked/banned).

In addition to this I have installed jdk1.7u4 (non-RPM) manually by unpacking it into /usr/java/jdk1.7.0_04, but it is the 1.6 version I want Yast to recognize.

On 07/02/2012 08:56 PM, DJViking wrote:
>
> How do I get YAST to recognize a manually installed Java installation?
> I have installed the rpm-bin package of JDK-1.6u33 from Sun/Oracle.

did you install it by running an rpm command?
if that is what you mean by “manual” then don’t do that any
more…instead, right click the rpm and select “Open With” > “YaST” or
“Install/Remove Software” (but, you didn’t declare either your operating
system version or desktop environment, so i don’t know for sure if you
can follow those directions!)

> This installation is visible in YAST, but when upgrading LibreOffice it
> complains about a missing Java dependency and wants to install
> openJDK(which I have locked/banned).

and once installed there is a place inside LibreOffice set up to fiddle
with java…again, i have no idea what version OS or DE or LibreOffice
you are using but maybe if you look in Tools > Options > LibreOffice >
Java and then click “Help” button at the bottom of that window, there
may be some useful hints there (i do not know)…but, for SURE if you
didn’t install Java by using YaST then you cannot count on the RPM
command to have placed all the links in all the right places where YaST
will see it, and ‘tell’ LibreOffice what is available…so, be sure to
try reinstalling that rpm with YaST or Install/Remove…(i think they
are the same)

oh, i guess i should have asked: you wrote: “but when upgrading
LibreOffice it complains”

so, you “upgraded” from what LO version to what new one? or rather you
are trying to upgrade but can’t because it declares it must have the
open JDK…so, i wonder where/how you got the new upgrade package

that is, how did you do that? did you use YaST Software Management or
zypper, or what?

and why are you “upgrading”? was the one you had missing a critical
capability? or ??

> In addition to this I have installed jdk1.7u4 (non-RPM) manually by
> unpacking it into /usr/java/jdk1.7.0_04,

i don’t have any idea what that means… !
but it is nothing i have ever done before!!

oh WAIT, maybe you are using 12.1 and need to look at this
http://en.opensuse.org/SDB:Installing_Java

> but it is the 1.6 version I want Yast to recognize.

it is possible to have more than one version of Java installed, and then
use the LibreOffice set up to tell it which to use


dd

I think you misunderstood a little and/or I did not explain good enough.

I have installed via RPM. LibreOffice itself has no problem finding and using the installed Java. But using Yast to install/upgrade packages, I get a warning that the package (in this case LibreOffice) requires openjdk (I have to select ignore on this in order to upgrade). What I want is for YaST Software Management to recognize that I do have a JDK installed and not suggest I install openJdk.

If you need more than one java version installed, you have to manually unpack it yourself, otherwise installing a different version using RPM will replace the existing RPM version. Therefor I unpacked JDK1.7 manually (from a tar.gz file. Not really relevant for this problem, only to indicate that I have more than one version of Java installed. However only one is installed with RPM).

On 2012-07-02 22:46, DJViking wrote:
>
> I think you misunderstood a little and/or I did not explain good enough.
>
> I have installed via RPM. LibreOffice itself has no problem finding and
> using the installed Java. But using Yast to install/upgrade packages, I
> get a warning that the package (in this case LibreOffice) requires
> openjdk (I have to select ignore on this in order to upgrade). What I
> want is for YaST Software Management to recognize that I do have a JDK
> installed and not suggest I install openJdk.

It is not possible.

You have to install the JDK version, taboo the SUN version that YaST would
install, and install externally the SUN version without YaST, but via rpm
command. This version will not be recognized by YaST as valid, but it does
not matter.

Download the java rpm from SUN - better than the binary, as it will be
easier to replace (update). The procedure would be (mutandis mutandi):



First as root:

# rpm --erase --nodeps java-1_6_0-sun-alsa java-1_6_0-sun-plugin java-1_6_0-sun

(remove the original SUN java version if it was installed)

# cd ~/downloads/
# ./jre-6u32-linux-x64-rpm.bin     (expands jre-6u32-linux-amd64.rpm)
# rpm -i jre-6u32-linux-amd64.rpm

# update-alternatives --list java
# update-alternatives --install "/usr/bin/java" "java"
"/usr/java/default/bin/java" 1
# update-alternatives --set java /usr/java/default/bin/java
# update-alternatives --list java

It is installed on "/usr/java/default"

Now as user, and for all users:

> ln -s /usr/java/default/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Verify by browsing to:

http://java.com/en/download/installed.jsp


This way Yast will be happy, as there is installed one of the versions it
wants, and you will be happy because the default version is yours (the one
from SUN). And LibreOffice will find all versions and work with the one you
choose.

:slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I have already installed the RPM and it is showing up in YaST. Although I tried those update-alternatives commands and it did seem to do the trick.

dddddd@linux-1wa3:~/Downloads> sudo /usr/sbin/update-alternatives --install “/usr/java/” “java” “/usr/java/default/bin/java” 1
update-alternatives: using /usr/java/default/bin/java to provide /usr/java/ (java) in auto mode.
update-alternatives: warning: not replacing /usr/java/ with a link.

dddddd@linux-1wa3:~/Downloads> sudo /usr/sbin/update-alternatives --set java /usr/java/default/bin/java
update-alternatives: warning: forcing reinstallation of alternative /usr/java/default/bin/java because link group java is broken.
update-alternatives: warning: not replacing /usr/java/ with a link.

dddddd@linux-1wa3:~/Downloads> sudo /usr/sbin/update-alternatives --list java
/usr/java/default/bin/java

There’s a easier way go here:
https://sites.google.com/site/easylinuxtipsproject/java-for-opensuse
Then after that if it hasn’t been done already use Yast to install openjdk. You’ll want java-1_6_0-openjdk.
Then open Libre Office
1.Click Tools select Options
2.Expand the Libre Office that show up in the left pane
3.Select Java
4. Select 1.6.0_24 click OK
Libre Office works best with the openjdk & it can safely be in use alongside Java 1.7 from Oracle.
Just use 1.7 for your browsers and 1.6 for Libre office WFM.