Installing Oracle Java Development Kit on SLES 12 SP1

Dear All,

I have a SLES 12 SP1 machine on which I need to install Oracle Java Development Kit.

I downloaded form orcale official site a jdk package, jdk-8u102-linux-x64.rpm, but I still have a few issues.

Following the guides on internet i run

rpm -ivh jdk-8u102-linux-x64.rpm

and i get an error

update-alternatives: using /usr/java/jdk1.8.0_102/jre/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: error: alternative ControlPanel can’t be slave of javac: it is a slave of java
warning: %post(jdk1.8.0_102-2000:1.8.0_102-fcs.x86_64) scriptlet failed, exit status 2

Well now if I run java --version i get a response but I would automate this step into a script and I can’t receive an error during Oracle Java Installation.

The last strange thing is that

rpm -e jdk-8u102-linux-x64.rpm

tell me the package is not present

but running again

rpm -ivh jdk-8u102-linux-x64.rpm

tell me that the package is installed.

Does anyone can help me?

Thanks
Roberto

On 09/13/2016 07:44 AM, kamakay wrote:[color=blue]

I have a SLES 12 SP1 machine on which I need to install Oracle Java
Development Kit.

I downloaded form orcale official site a jdk package,
jdk-8u102-linux-x64.rpm, but I still have a few issues.

Following the guides on internet i run

rpm -ivh jdk-8u102-linux-x64.rpm[/color]

There are at least two installs. If you just need a JDK somewhere, you
can use the tarball install which just extracts wherever you want it and
then you can point your applications that need Java to that location.
Easy peasy, no package management stuff, etc. I’m not saying you SHOULD
do that, but it’s an easy option too.
[color=blue]

and i get an error

-update-alternatives: using /usr/java/jdk1.8.0_102/jre/bin/java to
provide /usr/bin/java (java) in auto mode
update-alternatives: error: alternative ControlPanel can’t be slave of
javac: it is a slave of java
warning: %post(jdk1.8.0_102-2000:1.8.0_102-fcs.x86_64) scriptlet failed,
exit status 2-

Well now if I run java --version i get a response but I would automate
this step into a script and I can’t receive an error during Oracle Java
Installation.[/color]

If the install works, what’s wrong with getting an update-alternatives
error that is probably either cosmetic or, if it deals with ControlPanel,
irrelevant to actually running the ‘java’ executable?
[color=blue]

The last strange thing is that

rpm -e jdk-8u102-linux-x64.rpm[/color]

This command is wrong; the manpage for ‘rpm’ indicates you need a package
name when removing an RPM, not a package file; the package file is not
installed, the package is, and you are specifying the file. Try just
‘jdk-8u102’ or maybe just ‘jdk’, whatever the name of the actual package
is/was.
[color=blue]

tell me the package is not present

but running again

rpm -ivh jdk-8u102-linux-x64.rpm

tell me that the package is installed.[/color]

Yes, because it is; you should be done.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Thanks!

This is a stupid error, keep learning more about Suse!

Thanks again!
Roberto