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 JRE for Ubuntu, Linux Mint and Debian


Back to the home page

Are you visiting this website with Chrome or Chromium? Then you might 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....


Primary choice: OpenJDK and not Oracle (Sun) Java

For Java there's a good open source application available: OpenJDK and the IcedTea plug-in. They are available in the regular Ubuntu repositories and receive regular security updates. For many people this Java is adequate.

That's why the closed source Oracle (Sun) Java Runtime Environment (JRE) has been removed from the official software repositories of Ubuntu. It has even disappeared from the Partners repository.

Do the following in order to install openJDK and the IcedTea plug-in:
- Launch Ubuntu Software Center
- Query: icedtea
- Click on Icedtea Java-plug-in (icedtea-7-plugin) and install it. OpenJDK will be installed automatically as well.

So: OpenJDK and the IcedTea Plug-in are adequate for many people.

However....

How-to for Oracle (Sun) Java JRE

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

Tip 1: you can use this tutorial in Linux Mint and Debian as well.

Tip 2: for openSUSE, use this slightly different how-to.

When you want JRE in Ubuntu, 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, either by maliciousness or by simple neglect (outdated insecure version).

The repository of duinsoft.nl

There is a positive exception: the repository of duinsoft.nl, which is owned by a respected member of the Dutch Ubuntu community. This contains a script that will always pull the latest Oracle Java from the Oracle website, and install it in your system.

Do you prefer the manual way? Then read on below; it's almost as easy as using the Duinsoft repo.


Installing manually is not hard, 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 Ubuntu or Mint! 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

The default generic version of Ubuntu and Mint is 32 bit, but many people have a 64 bit system.

If you're unsure about your system version, check it like this.

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

HOW-TO FOR 32 BIT UBUNTU AND LINUX MINT


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). Only the browser plug-in needs to be removed! Otherwise unwanted side effects may occur.

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 and the IcedTea browser plug-in. Only the IcedTea browser plug-in (icedtea-6-jre-cacao) should be removed; openJDK itself can remain on your hard disk.

Like this:

Click on Ubuntu Software Center (the shopping bag) in the side panel. Mint: launch Software Manager.
Query: icedtea.

Remove only the IcedTea Java-plug-in. Leave openJDK itself on your hard disk.

Press the Remove button.

Get JRE

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

For 32 bit you want Linux; the name of this file ends on .tar.gz. You don't want Linux RPM, of which the file name ends on i586.rpm Because RPM is not built for Ubuntu and Linux Mint, but for other Linux distro's.

Note: 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. Create a new subfolder in the folder opt, by means of a command.

Click on the grey Ubuntu logo (Dash home). Query: terminal. Click on Terminal.

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

Press Enter.

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


2. Now 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.


3. Move the unpacked contents of the JRE file into the system folder that you created in step 1, with the following command.

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

Press Enter.

Inform the system and make the new JRE the default

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

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

Press Enter.

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


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

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

Press Enter.

Install the Firefox plugin

6. Installing the Firefox plugin is simple. First 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.


7. Now remove the IcedTea plugin, if it has been installed.

Type (copy/paste):
sudo apt-get remove icedtea-6-plugin && sudo apt-get remove icedtea-7-plugin

Press Enter.

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

8. Remove a former version of the Java plugin (may or may not be present, 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.

Final check

10. 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

11. 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

12. By default, Java allows itself to use a crazy maximum amount of disk space for the cache. 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.

Use it to limit the disk usage of temporary Java applications, because the default maximum is insanely high (repeat this in each user account):
Temporary Internet Files - Settings... Disk Space: limit it to 50 MB.
Click Delete Files... OK - OK - Apply - OK.

Repeat this in every user account.

Do you have a Solid State Drive (SSD)? Then disable this cache entirely, as you'll want to limit write actions as much as possible for an SSD.

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

13. 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. Remove the folder /opt/java and what's in it, by means of the following terminal command.

Click on the grey Ubuntu logo (Dash home). Query: terminal. Click on Terminal.

Type (copy/paste):
sudo rm -r -v /opt/java

Press Enter.

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

b. Then remove the Java plugin:

Type in the terminal (copy/paste):

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

Press Enter.

c. Finally, restart your web browser.

Note: are there multiple user accounts? Then repeat step b 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 Ubuntu and Linux Mint? There's a lot more of them on this website!

For example:

Speed up your Ubuntu

Firefox: improve it

Chrome: tweak it

Libre Office: tune it

Solid State Drive (SSD): optimize it


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 UBUNTU AND LINUX MINT


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). Only the browser plug-in needs to be removed! Otherwise unwanted side effects may occur.

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 and the IcedTea browser plug-in. The IcedTea browser plug-in (icedtea-6-jre-cacao) should be removed; openJDK itself can remain on your hard disk.

Like this:

Click on Ubuntu Software Center (the shopping bag) in the side panel. Mint: launch Software Manager.
Query: icedtea.

Remove only the IcedTea Java-plug-in. Leave OpenJDK itself on your hard disk.

Press the Remove button.

Get JRE

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

For 64-bit you want Linux x64. The name of this file ends on .tar.gz. Do not pick Linux x64 RPM (file name ends on x64.rpm), because RPM is not built for Ubuntu and Linux Mint, but for other Linux distro's.

Note: 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. Create a new subfolder in the folder opt, by means of a command.

Click on the grey Ubuntu logo (Dash home). Query: terminal.
Click on Terminal.

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

Press Enter.

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


2. Now 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.


3. Move the unpacked contents of the JRE file into the system folder that you created in step 1, with the following command.

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

Press Enter.

Inform the system and make the new JRE the default

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

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

Press Enter.

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


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

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

Press Enter.

Install the Firefox plugin

6. Installing the Firefox plugin is simple. First 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.


7. Now remove the IcedTea plugin, if it has been installed.

Type (copy/paste):
sudo apt-get remove icedtea-6-plugin && sudo apt-get remove icedtea-7-plugin

Press Enter.

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

8. Remove an older version of the Java plugin.

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.

Final check

10. 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

11. 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

12. 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.

Do you have a Solid State Drive (SSD)? Then disable this cache entirely, as you'll want to limit write actions as much as possible for an SSD.

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

13. 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. Remove the folder /opt/java and what's in it, by means of the following terminal command.

Click on the grey Ubuntu logo (Dash home). Query: terminal.
Click on Terminal.

Type (copy/paste):
sudo rm -r -v /opt/java

Press Enter.

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

b. Then in the terminal, in order to remove the Java plugin:

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

Press Enter.

c. Finally, restart your web browser.

Note: are there multiple user accounts? Then repeat step b 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 Ubuntu and Linux Mint? There's a lot more of them on this website!

For example:

Speed up your Ubuntu

Firefox: improve it

Chrome: tweak it

Libre Office: tune it

Solid State Drive (SSD): optimize it

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


Comments