Installing Oracle Java through oracle-java-installer rpm

Hi all,

I just spent some time creating a package, which will download java from oracle’s website and install it on the computer. It will install java in the following location:
/opt/java/32/
or
/opt/java/64/. I followed this guide to create the package:Oracle (Sun) Java for openSUSE and Fedora - Easy Linux tips project

The package will download and install jre and java plugin and will add new entries in “update-alternatives” and set the oracle-java as default java. It adds update-alternatives entries for, java and javaws.
It also links libnpjp2.so from /usr/lib/browser-plugins/javaplugin.so for mozilla plugin.

It should also remove those entries (except for the soft link for java plugin) while uninstalling.

you can find the package “oracle-java-installer” here:
Index of /repositories/home:/wildnux/openSUSE_12.1

Please feel free to use/edit/improve it :slight_smile:

On 01/06/2012 04:16 PM, wildnux wrote:
>
> /opt/java/32/ or /opt/java/64/

thanks, but is that the SUSE-standard place for java?


DD
openSUSE®, the “German Engineered Automobiles” of operating systems!

Excellent! Thanks for your effort! :slight_smile:

On Fri, 06 Jan 2012 17:50:00 +0000, DenverD wrote:

> On 01/06/2012 04:16 PM, wildnux wrote:
>>
>> /opt/java/32/ or /opt/java/64/
>
> thanks, but is that the SUSE-standard place for java?

No, but if you want to install mutiple JVMs, then they all can’t go in
the same place. :slight_smile:

Jim


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

nope :slight_smile: I honestly don’t know where it should go. (I actually thought about that).

then again, I just made the package to automate the process to install java (the process that official opensuse wiki links us to)

and added “javaws” to the “update-alternatives” as a bonus to “java” only :stuck_out_tongue:

It should uninstall them by deleting the java installation and removing the alternative entry with “update-alternatives --remove”.
though it will not remove the link to javaplugin.so, I figured other installation might overwrite that link, so did not remove it. :slight_smile:

please feel free to improve it.

On 01/07/2012 08:36 AM, wildnux wrote:
> please feel free to improve it.

if i were technically capable of that i would try…but i’m not…

when i get around to installing 12.1 my plan is to just not install the
openJDK (or remove it with YaST) and instead either install the JRE/JDK
RPM offered by Oracle with YaST, or if that fails i’ll use YaST again to
remove the RPM and then download and compile/install from the source
tarball… both available here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html

well, actually i hope that soon the open version works with everything
i need it to work with (mostly online banking or broker password
processing)…


DD http://tinyurl.com/DD-Caveat http://tinyurl.com/DD-Hardware
http://tinyurl.com/DD-Software
openSUSE®, the “German Engineered Automobiles” of operating systems!

On 01/07/2012 04:56 AM, Jim Henderson wrote:
> No, but if you want to install mutiple JVMs, then they all can’t go in
> the same place.:slight_smile:

i’ve had multiple versions many times in the past, and none of them were
in /opt (i don’t even remember an /opt until just a very few years ago),
as far as i recall SUSE/openSUSE java packages were placed side by side
in directories named like

/usr/[something]/java-1.6.0-openjdk-1.6.0
/usr/[something]/java-1.6.0-openjdk-1.6.1
/usr/[something]/java-1.6.0-openjdk-1.6.2
/usr/[something]/java-1.6.0-sun-1.6.0
/usr/[something]/java-1.6.0-sun-1.6.1
/usr/[something]/java-1.6.0-sun-1.6.2

and it was possible to switch betweenwhich was active them using


update-alternatives --config java

but, that was way back in 10.2 or before…since then i’ve just avoided
the open version because they never seem to work with online
banks…and, once i find a version which works everywhere i need it (if
that is possible) i use YaST to uninstall the unwanted/unneeded…

but, i admit my memory may be hazy. (if not lazy:)


DD http://tinyurl.com/DD-Caveat
openSUSE®, the “German Engineered Automobiles” of operating systems!

Must be hazy, no [something] folders here :D.

There’s also: Index of /repositories/Java:/sun:/Factory/openSUSE_12.1

On Sat, 07 Jan 2012 13:13:33 +0000, DenverD wrote:

> i’ve had multiple versions many times in the past, and none of them were
> in /opt (i don’t even remember an /opt until just a very few years ago),
> as far as i recall SUSE/openSUSE java packages were placed side by side
> in directories named like

ISTR that /opt is part of LSB, but it’s used inconsistently by software
vendors.

Jim


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

On 2012-01-07 14:13, DenverD wrote:
> i’ve had multiple versions many times in the past, and none of them were in
> /opt (i don’t even remember an /opt until just a very few years ago), as
> far as i recall SUSE/openSUSE java packages were placed side by side in
> directories named like

/opt is the correct place for third party or commercial packages.


Cheers / Saludos,

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

On 2012-01-06 16:16, wildnux wrote:
> Hi all,
>
> I just spent some time creating a package, which will download java
> from oracle’s website and install it on the computer. It will install
> java in the following location:
> /opt/java/32/
> or
> /opt/java/64/.

There was a question in the factory or project mail list requesting such a
package. You should publish your post there and consider making an official
package.


Cheers / Saludos,

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

On 01/07/2012 08:53 PM, Carlos E. R. wrote:
> /opt is the correct place for third party or commercial packages.

dang, i have to learn something everyday–thanks! :slight_smile:

(problem is i am forgettin’ faster than i’m learnin’)


DD http://tinyurl.com/DD-Caveat
openSUSE®, the “German Engineered Automobiles” of operating systems!

Well that will make my package obsolete :stuck_out_tongue:

There was a question in the factory or project mail list requesting such a
package. You should publish your post there and consider making an official
package.

I am not subscribed to factory/project mail list, so I do not know how to post the message there. besides, I see there are already packages for 1.7.x early access versions on the official repositories. So, I don’t think I will need to tell them about this package.

this package I built may help those who wants the stable upto date java. (version 1.6.30 as of now also known as 6u30)

thank you for the heads up though :slight_smile:

Oracle Java 7.x is not stable yet, and only fit for testing purposes… I strongly recommend the use of Oracle Java 6 (6u30) in production machines. So I’m very happy with this package.

@wildnux: it would even be better though, if your package would be included in the official packages. Because Oracle Java 6 still is very important software, and we don’t know how long it will last before Oracle Java 7 will be stable… Maybe you can try to get it into the official repo? Or maybe into Packman…

The matter of /opt has been discussed already; I only wish to add, that Google Chrome (when downloaded as a separate package from the Google website) installs itself in /opt as well. :slight_smile:

On 2012-01-08 11:26, pjotr123 wrote:

> @wildnux: it would even be better though, if your package would be
> included in the official packages. Because Oracle Java 6 still is very
> important software, and we don’t know how long it will last before
> Oracle Java 7 will be stable… Maybe you can try to get it into the
> official repo?

which is why I suggested the factory mail list.


http://en.opensuse.org/openSUSE:Communication_channels#All_mailing_lists
http://en.opensuse.org/openSUSE:Mailing_lists


Cheers / Saludos,

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

Do you mean the script to get/pull (that oracle software) should be included (not the oracle java itself)?

Because (if I understood it the right way) at least the software itself is no longer allowed to be included in linux distributions because of changes in the licensing.
Compare:

-opensuse-factory mailing list: Thread: Focusing on OpenJDK - Sun/Oracle JDK will not be in 12.1
Started with
Focusing on OpenJDK […] From: Andreas Jaeger <aj@xxxxxxxx> Date: Thu, 01 Sep 2011 10:49:01 +0200

  • Bug 691880 - mbranch command does not work for java-1_6_0-sun
    with
    Comment 1

Regards
Martin
(pistazienfresser)

On 2012-01-12 13:36, pistazienfresser wrote:
>
> robin_listas;2429359 Wrote:

>> which is why I suggested the factory mail list.
>>
>> …]
>
> Do you mean the script to get/pull (that oracle software) should be
> included (not the oracle java itself)?

Right.

> Because (if I understood it the right way) -at least- the software
> itself is no longer allowed to be included in linux distributions
> because of changes in the licensing.

True, AFAIK. Wait: it can not be distributed. It can be installed if the
owner does it.

The java rpm can not be included, but an rpm that pulls automatically java
from their sources can be done. This was asked about in the factory mail
list, and they said that if any body volunteered to do it…

And SUSE have lawyers who can verify if it can be done. I would like it.

The Windows fonts can not be included, but we have an rpm that runs a
scripts that downloads those same fonts legally. It is the same kind of thing.


Cheers / Saludos,

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

Great job! Thanks.

Can you make it for the JDK also?

A little bug. You should change
if “$myarch” == “64”]; then
to
if “$myarch” == “64” ]; then

Notice the spaces. This makes it work as intended on 64 bits machines :slight_smile:

thank you tazly, I will change it :slight_smile: