Installing Oracle Java to run SAP gui Java 7.30 in openSUSE 12.3 64 bit

Hi, I need to install the latest oracle java (Version 7 Update 21) to evaluate the use of openSUSE 12.3 64 bit for some SAP users, I have found a lot of guides for doing it but all are differents, not entering in details about the location of those guides, my question is, what is the most easy, working and straightforward way to install Oracle Java to be able to run SAP GUI for Java 7.30 on openSUSE 12.3 64 bit?

thanks

On Wed, 24 Apr 2013 23:36:03 +0000, Easgs wrote:

> what is the most easy, working and straightforward way to install Oracle
> Java

It shouldn’t matter for SAP, but the simplest and most straightforward
way is to go to java.com and download the official package (Oracle
doesn’t allow anyone to redistribute it anymore IIRC) and install it
using Oracle’s instructions.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 2013-04-25 01:39, Jim Henderson wrote:
> On Wed, 24 Apr 2013 23:36:03 +0000, Easgs wrote:
>
>> what is the most easy, working and straightforward way to install Oracle
>> Java
>
> It shouldn’t matter for SAP, but the simplest and most straightforward
> way is to go to java.com and download the official package (Oracle
> doesn’t allow anyone to redistribute it anymore IIRC) and install it
> using Oracle’s instructions.

They come in two flavours: tgz and rpm. The rpm is preferable, IMHO,
because upgrading is easier.

Probably you also need to install any one of the openSUSE distributed
java versions (non oracle), because otherwise Yast will believe there is
no java if you install an application that has java as a dependency -
like libreoffice, for instance.

Then there are some tricks to do with update-alternatives to set the
oracle java as the default one. I have this in my old notes:


> # 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
> /usr/lib64/jvm/jre-1.5.0-gcj/bin/java
> /usr/java/default/bin/java


There is also a bug in the oracle supplied /etc/init.d/jexec script:


has:

### BEGIN INIT INFO
# Provides: binfmt_misc
# Required-Start: $local_fs
# Default-Start: 1 2 3 4 5
# Default-Start: 0 6
# chkconfig: 12345 95 05
# Description: Supports the direct execution of binary formats.
### END INIT INFO
#

should:

#CER: Required-Stop and Default-Stop were missing.
#
### BEGIN INIT INFO
# Provides: binfmt_misc
# Required-Start: $local_fs
# Required-Stop:
# Default-Start: 1 2 3 4 5
# Default-Stop: 0 6
# chkconfig: 12345 95 05
# Description: Supports the direct execution of binary formats.
### END INIT INFO
#


But I have not tried this in 12.3 yet.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On Wed, 24 Apr 2013 23:58:08 +0000, Carlos E. R. wrote:

> They come in two flavours: tgz and rpm. The rpm is preferable, IMHO,
> because upgrading is easier.

I seem to recall the RPM was wrapped in a .bin wrapper.

But good tips.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

https://en.opensuse.org/SDB:Installing_Java#Install_Oracle_Java_SE

http://haulynjason.net/weblog/2011/12/setup-sun-jdk-on-opensuse/

@op - did you try opnJDk first. It is a mature product now and it is easy to get updates for it through the repos.

On 2013-04-25 02:42, Jim Henderson wrote:
> On Wed, 24 Apr 2013 23:58:08 +0000, Carlos E. R. wrote:
>
>> They come in two flavours: tgz and rpm. The rpm is preferable, IMHO,
>> because upgrading is easier.
>
> I seem to recall the RPM was wrapped in a .bin wrapper.

Yes, for version 6. Version 7 is an rpm directly.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On Thu, 25 Apr 2013 09:28:18 +0000, Carlos E. R. wrote:

> On 2013-04-25 02:42, Jim Henderson wrote:
>> On Wed, 24 Apr 2013 23:58:08 +0000, Carlos E. R. wrote:
>>
>>> They come in two flavours: tgz and rpm. The rpm is preferable, IMHO,
>>> because upgrading is easier.
>>
>> I seem to recall the RPM was wrapped in a .bin wrapper.
>
> Yes, for version 6. Version 7 is an rpm directly.

I guess it says something about openJDK that my last experience with
Oracle’s java is version 6. :slight_smile:

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 2013-04-25 22:41, Jim Henderson wrote:
> On Thu, 25 Apr 2013 09:28:18 +0000, Carlos E. R. wrote:

>> Yes, for version 6. Version 7 is an rpm directly.
>
> I guess it says something about openJDK that my last experience with
> Oracle’s java is version 6. :slight_smile:

I know.

Oracle stopped upgrading version 6 in March, IIRC, so I was forced to go
to version 7. I need to use Oracle version if I want support with
problems with some java apps I need… not my personal choice.

This may change with time… who knows.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

I followed this guide

checked in the java site and it reports the right version, also in firefox about:plugins but if I run the command

java -version

I get this

linux-3uso:~ # java -version
java version “1.7.0_15”
OpenJDK Runtime Environment (IcedTea7 2.3.7) (suse-8.3.1-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
linux-3uso:~ #

It reports the OpenJDK not the Oracle Java which is Version 7 Update 21

thanks

On 2013-04-26 18:46, Easgs wrote:
>
> I followed this guide
>
> https://sites.google.com/site/easylinuxtipsproject/java-for-opensuse

That guide is fine, except that it uses the tar instead of the rpm.
That’s an error, IMHO.

> checked in the java site and it reports the right version, also in
> firefox about:plugins but if I run the command
>
> java -version
>
> I get this

Please use code tags for printouts and commands. Advanced editor, ‘#’
button. Posting in Code Tags - A Guide

> It reports the OpenJDK not the Oracle Java which is Version 7 Update 21

That’s step 5 on that guide (Inform the system and make the new JRE the
default), and is also written in the notes in my post.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

I did the steps as the guide says, su -p, but it didn’t work, doing it as root did the trick, check it out

eduardo@linux-3uso:~> su -p
Contraseña: 
linux-3uso:~ # update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.7.0_21/bin/java" 1
Absolute path to 'update-alternatives' is '/usr/sbin/update-alternatives', so running it may require superuser privileges (eg. root).

linux-3uso:~ # update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.7.0_21/bin/java" 1
Absolute path to 'update-alternatives' is '/usr/sbin/update-alternatives', so running it may require superuser privileges (eg. root).

linux-3uso:~ # update-alternatives --set java /opt/java/64/jre1.7.0_21/bin/java
Absolute path to 'update-alternatives' is '/usr/sbin/update-alternatives', so running it may require superuser privileges (eg. root).

linux-3uso:~ # java -version
java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7) (suse-8.3.1-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
linux-3uso:~ # exit
exit

eduardo@linux-3uso:~> su
Contraseña: 
linux-3uso:/home/eduardo # update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.7.0_21/bin/java" 1

linux-3uso:/home/eduardo # update-alternatives --set java /opt/java/64/jre1.7.0_21/bin/java
update-alternatives: using /opt/java/64/jre1.7.0_21/bin/java to provide /usr/bin/java (java) in manual mode

linux-3uso:/home/eduardo # java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
linux-3uso:/home/eduardo # exit
exit
eduardo@linux-3uso:~> java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
eduardo@linux-3uso:~> 


That guide is fine, except that it uses the tar instead of the rpm.
That’s an error, IMHO.

I did it with the rpm style and it worked

  1. install rpm with yast, right click rpm file, open with, add/remove programs, clic ok

  2. In yast software management, select icedtea-web to be removed and clic ok

  3. input these commands as root

update-alternatives --install "/usr/bin/java" "java" "/usr/java/jre1.7.0_21/bin/java" 1
update-alternatives --set java /usr/java/jre1.7.0_21/bin/java
  1. exit root and type su -p enter password for admin and type the following command

mkdir -v ~/.mozilla/plugins
ln -s /usr/java/jre1.7.0_21/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

  1. after that do this

Type in the terminal (copy/paste):


/usr/java/jre1.7.0_21/bin/ControlPanel

Press Enter.

Temporary Internet Files - Settings… Disk Space: limit it to 50 MB.
Click Delete Files… OK - OK - Apply - OK.

  1. optional to check thing enter these commands
#update-alternatives --list java


#java -version


thank a lot for your help.

On 2013-04-26 21:26, Easgs wrote:
>
>> That guide is fine, except that it uses the tar instead of the rpm.
>> That’s an error, IMHO.
>
> I did it with the rpm style and it worked

Good :slight_smile:

> 1) install rpm with yast, right click rpm file, open with, add/remove
> programs, clic ok
>
> 2) In yast software management, select icedtea-web to be removed

I would not do that.

Why? Because if you do, then the package manager will think that you
have no java installed, and will either remove all applications that
need java, or install another java version instead behind your back.

So you need to have one of the java versions that yast wants, and also,
oracle’s java. Both.

(YaST doesn’t recognize that Oracle’s Java is Java, because it does not
contain the expected “provides” sections)

> 3) input these commands as root

Note: use this to become root:


su -

Use other combinations when required and you know why :slight_smile:

> 4) exit root and type su -p enter password for admin and type the
> following command
>
>
> Code:
> --------------------
>
> mkdir -v ~/.mozilla/pluginsln -s /usr/java/jre1.7.0_21/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
>
> --------------------

Huh, no, you should have done that as plain user, no ‘su’ at all. You
are creating directories and links inside your own home, things there
should be owned by you, not by root :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

You were right, this is what I did now:

Installing

Run as Root

rpm -Uvh jre-7u21-linux-x64.rpm
update-alternatives --install "/usr/bin/java" "java" "/usr/java/jre1.7.0_21/bin/java" 1
update-alternatives --set java /usr/java/jre1.7.0_21/bin/java

Enabling the java plugin for firefox

Run as user

mkdir -v ~/.mozilla/plugins
ln -s /usr/java/jre1.7.0_21/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Fixing disk usage

Run as user

/usr/java/jre1.7.0_21/bin/ControlPanel

Temporary Internet Files - Settings… Disk Space: limit it to 50 MB.
Click Delete Files… OK - OK - Apply - OK.

Checking

Run as root

update-alternatives --list java

Run as user

java -version

that is all, you can just copy paste the commands if you wish.

that is what I mentioned at the begining af the thread, there are several guides out there to do this, and all are different, thanks for your help, now the next step for me is to install and test Sap Gui java client 7.30

Last minute note, with these commands as root

update-alternatives --install "/usr/lib64/browser-plugins/javaplugin.so" "javaplugin" "/usr/java/jre1.7.0_21/lib/amd64/libnpjp2.so" 1
update-alternatives --set javaplugin /usr/java/jre1.7.0_21/lib/amd64/libnpjp2.so

I didn’t have to do this

Run as user

 Code:

mkdir -v ~/.mozilla/plugins
ln -s /usr/java/jre1.7.0_21/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

and it worked also for chromium