# Installing Oracle Java Development Kit on SLES 12 SP1

**URL:** <https://forums.suse.com/t/installing-oracle-java-development-kit-on-sles-12-sp1/28631>\
**Category:** SLES Configure-Administer\
**Created:** [September 13, 2016, 4:43pm UTC](https://forums.suse.com/t/installing-oracle-java-development-kit-on-sles-12-sp1/28631 "2016-09-13T16:43:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamakay](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kamakay](https://forums.suse.com/u/kamakay)\
**Post date:** [September 13, 2016, 4:43pm UTC](https://forums.suse.com/t/installing-oracle-java-development-kit-on-sles-12-sp1/28631/1 "2016-09-13T16:43:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [September 13, 2016, 5:19pm UTC](https://forums.suse.com/t/installing-oracle-java-development-kit-on-sles-12-sp1/28631/2 "2016-09-13T17:19:54Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![kamakay](https://avatars.discourse-cdn.com/v4/letter/k/9d8465/32.png) [@kamakay](https://forums.suse.com/u/kamakay)\
**Post date:** [September 13, 2016, 10:21pm UTC](https://forums.suse.com/t/installing-oracle-java-development-kit-on-sles-12-sp1/28631/3 "2016-09-13T22:21:56Z")

</div>

Thanks!

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

Thanks again!  
Roberto
