Since 2009 this website is a complete quick guide for Linux, both for beginners and for experienced users!

Ubuntu 14.04 Trusty Tahr has been released!

A star of the Ubuntu family: Xubuntu!

3days since
Ubuntu 14.04 LTS Trusty Tahr

Release schedule of Ubuntu 14.04 LTS Trusty Tahr

12days since
end of life for Windows XP: quickly replace it by Linux!

The ideal replacement for Windows XP

Oracle (Sun) Java for openSUSE and Fedora


Back to the home page

Are you visiting this website with Chrome or Chromium? Then you may see an unjustified warning.



This website is being sponsored by Google Ads.

Are you using an ad blocker? Then you're also blocking my earnings from advertisements....

If you wish to support this website, you can (temporarily?) switch off your ad blocker. Thanks in advance....


Note: this how-to is written for openSUSE, but can also be used in Fedora, CentOS and Scientific Linux. The tutorial for Ubuntu, Linux Mint and Debian can be found here.

Oracle (Sun) Java: removed from all repositories

Oracle (Sun) Java Runtime Environment (JRE) has been removed from the official software repositories of openSUSE. The reason: license trouble. Luckily, its open source brother OpenJDK (and the IcedTea plugin) is a good alternative, for many people at least.

OpenJDK and the IcedTea plug-in are installed by default. They are available in the regular openSUSE repositories and receive regular security updates. OpenJDK and the Icedtea Plug-in are fine for many people.

However....

How-to for Oracle (Sun) Java JRE

However, some openSUSE users will still need Oracle (Sun) Java JRE. For those I have written this manual.

Tip: for Ubuntu, Linux Mint or Debian, use this slightly different how-to.

When you want JRE in openSUSE, you can use a manual method. A manual method has the advantage that you don't have to rely on shady third-party repositories, which may be unsafe.

Installing manually is not hard at all, although you have to use the terminal for that (yikes!). Precision is important: it only succeeds when you follow the instructions exactly.

Updates: check for them yourself!

A manually installed application receives no updates from openSUSE! For JRE, you'll have to take care of security updates yourself.

For that, you'll regularly want to check the verification website of Java, to see if there are updated versions available. JRE itself won't alert you (it only does that in Windows)

Oracle issues critical security updates on a fixed time schedule (emergencies excepted). On that page, look for the category Oracle Java SE Critical Patch Updates. It may be handy to write those dates in your agenda.

32 bit and 64 bit

Your openSUSE is either the 64 bit or the 32 bit version. If you're unsure which version you have, you can check it like this.

Below you'll find the instruction for 32 bit. In the column on the right you can find the how-to for 64 bit.


HOW-TO FOR 32 BIT OPENSUSE


Remove the browser plug-in of the old version

First you'll want to remove the browser plug-in of the old JRE or openJDK (if you have it).

When the old JRE has been installed manually in /opt/java, see the instruction at the bottom of this column (under the header Removal).

If you don't have JRE, then you probably have openJDK. OpenJDK's web browser plugin (IcedTea) should be completely removed.
Note: leave openJDK itself installed, otherwise malfunctions may occur!

Like this:

Click on Install/Remove Software.
Query: icedtea

Mark icedtea-web for removal. This is the web browser plug-in of openJDK.

Press Accept.

Get JRE

Get the right file from the Java website: http://www.java.com

Note: for 32 bit you want Linux; the name of this file ends on .tar.gz.

Don't choose Linux RPM, of which the file name ends onĀ i586.rpm. Because I have written this how-to for the .tar.gz file. DO NOT PICK THE RPM, or you won't be able to use this how-to.

Store the file in the folder Downloads. So in:
/home/your-user-name/Downloads
Firefox puts downloaded files there by default, but not all web browsers do it like that.

For example, user John should place the file in:
/home/john/Downloads
When in doubt, check it.

This is important for the terminal commands that you'll execute later on, because otherwise they won't be correct.

Install JRE (32-bit)

Note: the terminal commands in this how-to possibly refer to an older version of JRE. When there's a newer version, you can simply adapt the file names in the terminal commands.

This how-to has been written for JRE 7 update 55 (32 bit version).


1. Go to the Downloads folder and unpack the compressed JRE file that you just downloaded, with the following combined command.

Type (copy/paste):
cd Downloads && tar xvzf ~/Downloads/jre-7u55-linux-i586.tar.gz

Press Enter.


2. Now open a terminal and make yourself root in a special and unusual way, namely with preservation of the current user environment variables:
type su -p and press Enter.

Type your password. You won't see anything, not even dots, this is normal.

Press Enter.


3. Create a new subfolder in the folder opt, by means of a command.

Type (use copy/paste: rapidly click three times on the blue line, in order to select the entire line):
mkdir -p -v /opt/java/32

Press Enter.


4. Move the unpacked contents of the JRE file into the new system folder that you just created, with the following command.

Type (copy/paste):
mv -v ~/Downloads/jre1.7.0_55 /opt/java/32

Press Enter.

Inform the system and make the new JRE the default

5. Now you'll want to tell the system, that there's a new Java version available.

Type (this one line, use copy/paste):
update-alternatives --install "/usr/bin/java" "java" "/opt/java/32/jre1.7.0_55/bin/java" 1

Press Enter.

Note 1: at this point, you'll get this warning:
Absolute path to 'update-alternatives' is '/usr/sbin/update-alternatives', so running it may require superuser privileges (eg. root).
You can safely ignore this: it's simply a result of running su with the parameter -p, which leads the system to think that maybe you're not root after all. But you are, and the job is being done allright.

Note 2: are you updating from a previous Java version, which you have removed manually? Then you'll possibly need to execute the above command twice, in case you'll get another error message the first time.


6. Tell the system, that the new Java must be the default:

Type (copy/paste):
update-alternatives --set java /opt/java/32/jre1.7.0_55/bin/java

Press Enter.

(Like previously, ignore the root message)

Install the Firefox plugin

7. Installing the Firefox plugin is simple.

By now, su -p has done its part of the job. So first quit the su mode:
Type in the terminal:
exit

Press Enter.

Then execute a command in order to create a certain folder (if it doesn't exist already).

Type in the terminal (copy/paste):
mkdir -v ~/.mozilla/plugins

Press Enter.

If it exists already, you'll see a notification of that.


8. Remove a former version of the Java plugin (may or may not be present, but run the command just to make sure).

Type (copy/paste):
rm -v ~/.mozilla/plugins/libnpjp2.so

If it's not there to begin with, you'll see a notification of that.

Press Enter.


9. Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located).

Type (copy/paste):
ln -s /opt/java/32/jre1.7.0_55/lib/i386/libnpjp2.so ~/.mozilla/plugins/

Press Enter.


10. Close the terminal.

Final check

11. Now close and restart Firefox. Check whether everything has succeeded. Type in the URL bar of Firefox (not in the terminal!):

about:plugins

Press Enter.

And scroll down, until you see something approximately similar to this:
Java(TM) Plug-in 10.55.2

You can also use this website (note that this website sometimes doesn't work, even when your Java is perfectly alright):
http://java.com/en/download/installed.jsp

Only enable the plugin when needed

12. Java is frequently under attack from malicious software on websites. Java is platform independent, so Linux is vulnerable, too. Therefore it's better to disable the plugin and only enable it for a short while, whenever you need it. You can do that as follows.

Note: this only applies to Java. There's also Javascript, which is quite safe. So there's no need to disable Javascript as well.

Tame disk usage with Sun Java 7 Plugin Control Panel

13. By default, Java allows itself to use a crazy maximum amount of disk space for the cache (what were the developers smoking?). You can limit that as follows:

Call up the Control Panel as follows (in each user account):

Open a terminal.

Type (copy/paste):
/opt/java/32/jre1.7.0_55/bin/ControlPanel

Press Enter.

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

Repeat this in each user account, as it's a user preference.

Note: this command is only for JRE 7 update 55. You'll need to adapt it when you use another version.

Other user accounts: repeat three commands and limit disk usage

14. Are there any other user accounts on the computer? Then repeat the following three commands in each user account:

rm -v ~/.mozilla/plugins/libnpjp2.so

and then (in case the plugins folder doesn't exist yet):

mkdir -v ~/.mozilla/plugins

and then:

ln -s /opt/java/32/jre1.7.0_55/lib/i386/libnpjp2.so ~/.mozilla/plugins/

Finally, use the control panel in those other user accounts, to limit the maximum disk usage of the cache (see step 12).

Removal

Do you wish to remove JRE again? It's very easy, to remove a manually installed JRE. As follows:

a. Open a terminal and make yourself root in a special and unusual way, namely with preservation of the current user environment variables:
type su -p and press Enter.
Type your password. You won't see anything, not even dots, this is normal.
Press Enter.

b. Then remove the folder /opt/java and what's in it. Copy/paste the following command in the terminal:

rm -r -v /opt/java

c. Then remove the Java plugin. Type in the terminal (copy/paste):

rm -v ~/.mozilla/plugins/libnpjp2.so

Press Enter.

Then close the terminal.

d. Now su has done its part of the job. Quit the su mode:
Type:
exit

Press Enter.

e. Finally, restart your web browser.

Note: are there multiple user accounts? Then repeat step c in those other accounts.

Updating an older version

It's easy to update an older version. Proceed as described above, under the header "Removal". Then install the new version.

Want more?

Do you want more tips and tweaks for openSUSE and Fedora? You can find those here.


To the content of this website applies a Creative Commons license.

Back to the home page

Disclaimer


This website is being sponsored by Google Ads.

Are you using an ad blocker? Then you're also blocking my earnings from advertisements....

If you wish to support my website, you can configure your ad blocker to make an exception for this website. Thanks in advance....



HOW-TO FOR 64 BIT OPENSUSE


Remove the browser plug-in of the old version

First you'll want to remove the browser plug-in of the old JRE or openJDK (if you have it).

When the old JRE has been installed manually in /opt/java, see the instruction at the bottom of this column (under the header Removal).

When you don't have an old JRE, you probably have openJDK. OpenJDK's web browser plugin (IcedTea) should be completely removed.
Note: leave openJDK itself installed, otherwise malfunctions may occur!

Like this:

Click on Install/Remove Software
Query: icedtea

Mark icedtea-web for removal. This is the web browser plug-in of openJDK.

Press Accept.

Get JRE

Get the right file from the Java website: http://www.java.com

Note: for 64-bit you want Linux x64 (file name ends on .tar.gz).

Do not choose Linux x64 RPM (file name ends on x64.rpm), because I have written this how-to for the .tar.gz file. DO NOT PICK THE RPM, or you won't be able to use this how-to.

Store the file in the folder Downloads. So in:
/home/your-user-name/Downloads
Firefox puts downloaded files there by default, but not all web browsers do it like that.

For example, user John should place the file in:
/home/john/Downloads
When in doubt, check it.

This is important for the terminal commands that you'll execute later on; otherwise they won't be correct.

Install JRE (64-bit)

Note: the terminal commands in this how-to possibly refer to an older version of JRE. When there's a newer version, you can simply adapt the file names in the terminal commands.

This how-to has been written for JRE 7 update 55 (64 bit version).


1. Go to the Downloads folder and unpack the compressed JRE file that you just downloaded, with the following combined command.

Type (copy/paste):
cd Downloads && tar xvzf ~/Downloads/jre-7u55-linux-x64.tar.gz

Press Enter.


2. Now open a terminal and make yourself root in a special and unusual way, namely with preservation of the current user environment variables:
type su -p and press Enter.

Type your password. You won't see anything, not even dots, this is normal.

Press Enter.


3. Create a new subfolder in the folder opt, by means of a command.

Type (use copy/paste: rapidly click three times on the blue line, in order to select the entire line).
mkdir -p -v /opt/java/64

Press Enter.


4. Move the unpacked contents of the JRE file into the new system folder that you just created, with the following command.

Type (copy/paste):
mv -v ~/Downloads/jre1.7.0_55 /opt/java/64

Press Enter.

Inform the system and make the new JRE the default

5. Now you'll want to tell the system, that there's a new Java version available.

Type (this is one line, use copy/paste):
update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.7.0_55/bin/java" 1

Press Enter.

Note 1: at this point, you'll get this warning:
Absolute path to 'update-alternatives' is '/usr/sbin/update-alternatives', so running it may require superuser privileges (eg. root).
You can safely ignore this: it's simply a result of running su with the parameter -p, which leads the system to think that maybe you're not root after all. But you are, and the job is being done allright.

Note 2: are you updating from a previous Java version, which you have removed manually? Then you'll possibly need to execute the above command twice, in case you'll get another error message the first time.


6. Tell the system, that the new Java must be the default.

Type (copy/paste):
update-alternatives --set java /opt/java/64/jre1.7.0_55/bin/java

Press Enter.

(Like previously, ignore the root message)

Install the Firefox plugin

7. Installing the Firefox plugin is simple.

By now, su -p has done its part of the job. So first quit the su mode:
Type in the terminal:
exit

Press Enter.


Then execute the following command, in order to create a certain folder (if it doesn't exist already).

Type in the terminal (copy/paste):
mkdir -v ~/.mozilla/plugins

Press Enter.

If it exists already, you'll see a notification of that.


8. Remove an older version of the Java plugin (may or may not be present, but run the command just to make sure).

Type (copy/paste):
rm -v ~/.mozilla/plugins/libnpjp2.so

Press Enter.

If it's not there to begin with, you'll get a notification of that.


9. Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located).

Type (copy/paste):
ln -s /opt/java/64/jre1.7.0_55/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Press Enter.


10. Close the terminal.

Final check

11. Now close and restart Firefox. Check whether everything has succeeded. Type in the URL bar of Firefox (not in the terminal!):

about:plugins

Press Enter.

And scroll down, until you see something approximately similar to this:
Java(TM) Plug-in 10.55.2

You can also use this website (note that this website sometimes doesn't work, even when your Java is perfectly alright):
http://java.com/en/download/installed.jsp

Only enable the plugin when needed

12. Java is frequently under attack from malicious software on websites. Java is platform independent, so Linux is vulnerable, too. Therefore it's better to disable the plugin and only enable it for a short while, whenever you need it. You can do that as follows.

Note: this only applies to Java. There's also Javascript, which is quite safe. So there's no need to disable Javascript as well.

Tame disk usage with Sun Java 7 Plugin Control Panel

13. By default, Java allows itself to use a crazy maximum amount of disk space for the cache (what were the developers smoking?). You can limit that as follows:

Call up the Control Panel as follows (in each user account):

Type in the terminal (copy/paste):
/opt/java/64/jre1.7.0_55/bin/ControlPanel

Press Enter.

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

Repeat this in each user account, as it's a user preference.

Note: this command is only for JRE 7 update 55. You'll need to adapt it when you use another version.

Other user accounts: repeat three commands

14. Are there any other user accounts on the computer? Then repeat the following three commands in each user account:

rm -v ~/.mozilla/plugins/libnpjp2.so

and then (in case the plugins folder doesn't exist yet):

mkdir -v ~/.mozilla/plugins

and then:

ln -s /opt/java/64/jre1.7.0_55/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Finally, use the control panel in those other user accounts, to limit the maximum disk usage of the cache (see step 12).

Removal

Do you wish to remove JRE again? It's very easy, to remove a manually installed JRE. As follows:

a. Open a terminal and make yourself root in a special and unusual way, namely with preservation of the current user environment variables:
type su -p and press Enter.

Type your password. You won't see anything, not even dots, this is normal.
Press Enter.
b. Then remove the folder /opt/java and what's in it. Copy/paste the following command in the terminal:

rm -r -v /opt/java

c. Then remove the Java plugin. Type in the terminal (copy/paste):

rm -v ~/.mozilla/plugins/libnpjp2.so

Press Enter.

Then close the terminal.

d. Now su -p has done its part of the job. Quit the su mode:
Type:
exit

Press Enter.

e. Finally, restart your web browser.

Note: are there multiple user accounts? Then repeat step c in those other accounts.

Updating an older version

It's easy to update an older version. Proceed as described above, under the header "Removal". Then install the new version.

Want more?

Do you want more tips and tweaks for openSUSE and Fedora? You can find those here.


To the content of this website applies a Creative Commons license.


Comments