I am using Ubuntu 11.04 Natty Narwhal. I recently installed openjdk-jre6 because one of the websites I use requires java for me to log in. Unfortunately, even after installing openjdk-jre6, I am not able to use the website. In place of 2 text boxes where I am supposed to enter my username and password, it simply shows a message "click here to download plugin". I am using Firefox by the way. I even tried to install java by clicking on that message. But it says "Java Runtime Environment not available". And then gives me a button to install java manually. But I would rather install it from the repo's.

Could someone please tell me, what I should do to get Firefox to take note of the openjdk-jre6 that I have already installed?

link|improve this question

20% accept rate
feedback

6 Answers

up vote 15 down vote accepted

Installing OpenJDK is not enough for enabling Java in browsers. You'll also need to install the icedtea6-plugin packge. A restart of the browser might be required.

The current stable version installs Firefox as a dependency. Firefox is not the only browser that can work with Java, and someone has already submitted a bug request about it. A fix has been released and is awaiting to be released (it's in the proposed updates repository). If you want to install the latest package without touching other packages on the system:

  1. Enable the proposed updates repository
  2. Refresh the packages information
  3. Install icedtea6-plugin Install icedtea6-plugin
  4. Disable the proposed updates repository
link|improve this answer
Which is included in the Ubuntu restricted extras right ? – Binarylife Jun 13 '11 at 9:11
1  
Yes, it does, but what if one does not want all dependencies from the restricted extras? – Lekensteyn Jun 13 '11 at 9:16
Ah I see, I agree – Binarylife Jun 13 '11 at 9:22
@Lekensteyn So you say I have to install icedtea6-plugin if I am using firefox. What would I have to install if I am using chromium? Cos I just switched from firefox to chromium. And so uninstalled firefox completely. Now when I try to install icedtea6-plugin using aptitude, it says it needs to install firefox all over again to satisfy dependencies. – Jay Jun 13 '11 at 9:33
That issue has already been discussed: bugs.launchpad.net/ubuntu/+bug/766559. A fix is on the way. If you need it now, enable the proposed updates repository source. I'll add further instructions to my answer – Lekensteyn Jun 13 '11 at 9:43
show 1 more comment
feedback
up vote 14 down vote
+200

There are several implementations of Java, the 3 most common implementations when talking about it for Ubuntu are:

  • OpenJDK: The primary goal of the OpenJDK project is to produce an open-source implementation of the Java SE Platform (6 and 7). This is the default version of Java that Ubuntu uses and is the easiest to install.
  • Sun Java: Sun Java is the reference implementation for Java 6. It's support has been discontinued in Ubuntu.
  • Oracle Java: Oracle Java is the OpenJDK Java Se Platform version 7 implementation from Oracle. Oracle introduced with this implementation a license that prevents distribution.

Since Ubuntu 11.10 and due to license issues Ubuntu will no longer distribute Oracle's JDK and JRE. Also previous versions supplied on PPAs suffer from security issues are are not recommended to be installed on any Ubuntu system.

There are no more supported .deb releases from Ubuntu with reference to Sun Java or Oracle Java, Ubuntu officially supports OpenJDK and OpenJRE implementation of Java which is the base for Oracle's own implementation.

OpenJRE is the official implementation of Java Runtime Environment for your Ubuntu systems and should suffice to run any Java program that you might require and its included in the main repo and its easily installable.

OpenJRE (click to install) can be installed by opening a terminal and typing

sudo apt-get install openjdk-7-jre

Or look for openjdk-7-jre in the Ubuntu Software Center.

The openjdk-7-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-7-jdk (click to install) package.


Also important is to install the wrapper for supporting Java applications on your web browser Iced-Tea Java Plugin.

IcedTea Plugin (click to install) can be installed on the terminal using

sudo apt-get install icedtea-plugin

Or look for icedtea-plugin in the Ubuntu Software Center


To make sure that you are running the correct version of Java use this command to set your choice

sudo update-alternatives --config java

java -version should display the choice you previously made.


If you need to install OpenJDK-JRE6 or OpenJDK-JDK6

openjdk-6-jre (click to install) is available for installation for Ubuntu 8.04 and up.

Install it with

sudo apt-get install openjdk-6-jre

Or if you need the developers package openjdk-6-jdk (click to install) install it with

sudo apt-get install openjdk-6-jdk

A version of the icedtea-plugin (click to install) is also available to install if you are going to use OpenJDK6.

Install it with

sudo apt-get install icedtea6-plugin

If you really want to use Oracle's Java Se Platform

link|improve this answer
feedback

For installing Oracle Java 7:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo mkdir -p /usr/lib/mozilla/plugins #just in case, this will be added to the package in the next version
sudo apt-get install oracle-jdk7-installer
link|improve this answer
feedback

Just go to Aplications --> Ubuntu software center and then search for Java. enter image description here

link|improve this answer
Your answer would be that the OP installs the previous Java Runtime Environment, and not the latest version jre-6u25-linux-i586.bin – scouser73 Jun 13 '11 at 14:33
Scouser73, jre-6u25-linux-i586.bin sounds like the proprietary Java implementation from Oracle. This question is about OpenJDK. – Lekensteyn Jun 13 '11 at 19:01
The one that is marked (in orange) is the open-jdk java6 runtime! – Alvar Jun 13 '11 at 19:27
scouser73 is referring to a security update of Oracle Java. I don't know if the current version if affected, the installed JRE version is 6b22 but bear in mind that this is unrelated to the version number of Oracle Java, see dbhole.wordpress.com/2011/05/27/… – Lekensteyn Jun 13 '11 at 19:33
well, Scouser73 had problems with a we page. I only use the jdk and that is all I ever need so I thought it would help. – Alvar Jun 13 '11 at 20:38
feedback

There are a few ways to install Java in Ubuntu:

Install OpenJDK (The open source equivalent to Sun's Java) directly from Ubuntu Software Center. All you need to do is search for Java. That tends to work as is for me.

If you need Sun's Java, say if you want to play Minecraft, you download the JRE as you described from Java.com, but make sure your .bin-file can be executed. You do that by opening a terminal and typing the following (I will assume you have it in your Downloads folder so change the cd line accordingly if that's not where it is):

cd /home/user/Downloads
sudo chmod +x jre-6u31-linux-i586.bin

Then, you should be able to close your terminal, right click on your .bin-file and select "Execute", which should run the installer. If this is not an option, just do the following from terminal (in the same folder as the two other actions):

./jre-6u31-linux-i586.bin

That simply runs the specified file and if you successfully typed in the two first lines, the installation.

link|improve this answer
It is compressed rpm , so this method wont work in ubuntu – abcd Apr 7 at 14:03
You're absolutely right. I'll edit accordingly. – Jonas Christensen Apr 7 at 14:11
feedback

Unfortunately, because of issues with its license, Oracle Java is no longer distributed within the official Ubuntu repositories. You have two main options: either try OpenJDK -- an open source replacement for Oracle Java -- or proceed with the "manual" installation (which is exactly what you were trying to do). Both these options are described on the help wiki: https://help.ubuntu.com/community/Java. This page also include some other alternatives that, depending on your needs, you may find more suitable.

Just a side note: most of the time, with Ubuntu, you should not download software from the Internet, but rather use the Ubuntu Software Center. The software you'll find there is ensured to be stable, safe and to respect the standard conventions of the system. Oracle Java is just an exception to this rule.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.