46

I recently installed Ubuntu 14.04 on my computer and now my Java Version is not updated. I have Java so I dont need to install - just update the current version.

Can someone please tell me the command I have to use to get Version 7 Update 65?

I have tried: apt-get update and apt-get upgrade.

1
  • 1
    How did you first install Java ? Is it a version provided from the Ubuntu repositories ? – Benoit Aug 8 '14 at 10:02
70

Use ppa :

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

if you want java8 :

sudo apt-get install oracle-java8-installer

If you ABSOLUTELY need to have the latest update of java you must manualy install from official source, follow this tuto : http://www.cyberciti.biz/faq/howto-installing-oracle-java7-on-ubuntu-linux/

But I advise you to wait as ppa update

11
  • I tried this one but it will not install the newest version. I have checked it out on java-website. I have now version 7 update 65 and I want version 7 update 67. – kenneth Aug 8 '14 at 10:10
  • I have 32-bit computer. – kenneth Aug 8 '14 at 10:13
  • root@ubuntu:/home/kenneth# sudo apt-get install oracle-java7-installer Reading package lists... Done Building dependency tree Reading state information... Done oracle-java7-installer is already the newest version. 0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. – kenneth Aug 8 '14 at 10:19
  • I have recently update from 12.04 version to 14.04 version if this means anything? – kenneth Aug 8 '14 at 10:20
  • 1
    I just updated using - sudo apt-get update, and this resolved my issue. – santu Dec 27 '16 at 12:59
6

The newest OpenJDK Java packaged for trusty (14.04) right now is 7u55. You can check your Java version with java -version from the command line in Terminal.

If you want a newer one your best options will be to:

  • wait for an update from Ubuntu, OR

  • install the Oracle distribution of Java which currently is at 7u65:

    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer
    
4
  • okay. You know when the Oracle distribution of Java will be 7u67? I tell you because danish online banks will not allow you access unless you have the 7u67 version, so I hope this will be soon. – kenneth Aug 8 '14 at 10:33
  • kenneth@ubuntu:~$ java -version java version "1.7.0_65" Java(TM) SE Runtime Environment (build 1.7.0_65-b17) Java HotSpot(TM) Server VM (build 24.65-b04, mixed mode) – kenneth Aug 8 '14 at 10:39
  • 1
    Well, in this case there is no obvious reason why Danish banks are not accepting 7u65, because 7u67 (released Aug 4th, four days ago) has only one bugfix in it - which does not seem security related. – akafred Aug 8 '14 at 11:14
  • Okay, I found out it was only my bank who didnt accept access (Nordnet.dk) they are having trouble with NEM-ID in connection with java (crazy mandatory system, required by law), but told me another way to get in. Problem solved then - thanks. – kenneth Aug 8 '14 at 11:35
5

Found something useful here..

Installing Java with apt-get is easy. First, update the package index:

 sudo apt-get update

Check if Java is not already installed:

 java -version

Then install java jre/jdk :

 sudo apt-get install default-jre

 sudo apt-get install default-jdk

For details please go to : https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get

1
  • This worked great for me in March 2016. my system is always fairly up-to-date so just the last two commands (the installs) did it for up – Michael Durrant Mar 27 '16 at 15:09
2

Updated for Ubuntu 18.04

Use ppa :

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

For more infos see: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

if you want java9: (Now some Programs like JabRef still need Java8)

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java9-installer

On http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html you can see a detailed explanation how to install Java9, and how to change it to default.

if you want Java 10:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java10-installer

For more infos see: https://www.linuxuprising.com/2018/04/install-oracle-java-10-in-ubuntu-or.html

if you want Java 11:

sudo apt install openjdk-11-jre-headless
sudo apt install openjdk-11-jdk

If you need the latest update you can download it from

If you have problems to install the latest updates see: https://www.cyberciti.biz/faq/howto-installing-oracle-java7-on-ubuntu-linux/

This question uses content from

5
  • There have been several new questions posted in the past two months asking what to do because oracle-java9-installer returns this error: download failed Oracle JDK 9 is NOT installed. dpkg: error processing package oracle-java9-installer (--configure): subprocess installed post-installation script returned error exit status 1 . oracle-java8-installer returns the same error: download failed Has this problem been fixed? – karel Feb 2 '18 at 11:37
  • @karel can you explain how to reproduce the error (or add one or two Questions where to find them?) I installed Java8 and Java9 sudo apt-get install oracle-java8-installer sudo apt-get install oracle-java9-installer and set sudo apt-get install oracle-java8-set-default Java 8 as default. and I do not have any problems at all – JoKalliauer Feb 2 '18 at 12:23
  • All I wanted to know is if oracle-java8-installer and oracle-java9-installer are working now, so I could update this answer. – karel Feb 2 '18 at 12:40
  • @karel Actually I only tested it on Ubuntu 16.04. I did not get any warinings installing them. – JoKalliauer Feb 3 '18 at 13:50
  • You see what my problem is is that Oracle changed the location of its Java 8 and Java 9 files and what am I supposed to do now? Am I supposed to check back every day to see if the ppa is up-to-date again and I can start recommending people to use it again? I use the open source JDK from the Ubuntu repos because that's what Oracle uses to build its Java binaries anyway. – karel Feb 3 '18 at 13:56
1

Don't know why everyone has answered with oracle, but here is open jdk:

sudo apt-get install openjdk-7-jre

http://openjdk.java.net/install/

1

Another possible solution is to add the PPA repository from the project ubuntu-justched available in the Github. This will provide a little bit different solution because it will download the Oracle JRE tarball to a previously configured directory and generate a DEB package from it.

That way you won't depend on somebody else packing the JRE, you will do it yourself (don't worry, it will be an automatic process).

1
  • +1 for likely relevant answer. For curious users, the rationale of this solution is explained in this blog post. – user37165 Apr 4 '16 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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