Java JRE 8 install

32,561

The other responses for some weird reason did not work for me. So, to install java 1.8 (from Oracle), I alternatively ran this:

1: Add Oracle’s PPA (Personal Package Archive):

sudo add-apt-repository ppa:webupd8team/java

2: Then update your package repository

sudo apt-get update

3: Install Oracle JDK 8:

sudo apt-get install oracle-java8-installer

That got it working for me. Now, when I run java -version, I get:

java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode

For more details, see this post on Medium.com.

Share:
32,561

Related videos on Youtube

John Lexus
Author by

John Lexus

Updated on September 18, 2022

Comments

  • John Lexus
    John Lexus almost 2 years

    I am trying to install Java JRE 8 on my Linux machine (Ubuntu 14.04 (Trusty Tahr)). I've done two things:

    The first was follow Java's help page. I downloaded the tarball and installed it using the tar zxvf jre-8u73-linux-x64.tar.gz command. However, when I run:

    java -version
    

    I get: bash: /usr/bin/java: No such file or directory

    There are no configuration files, and the binary files in /bin/ are endless... I am not sure which I am supposed to execute. I tried to execute the java file, but that did nothing.

    So, I tried to just apt-get it. These are the commands I ran:

    add-apt-repository ppa:openjdk-r/ppa
    apt-get update
    apt-get install openjdk-8-jre
    

    However, again, when I run java -version, it displays the same thing.

    So I said screw it, let me just mkdir /usr/bin/java and try it again. I autoremoved the package, and reinstalled it. Now I just get bash: /usr/bin/java: Is a directory when I run java -version.

    How can I fix this?

    • sinecode
      sinecode almost 7 years
      With the command mkdir /usr/bin/java you create a directory not an executable, so that's why you get bash: /usr/bin/java: Is a directory. Try to remove /usr/bin/java, reinstall the package via ppa and apt and write the output of the command ls -l /usr/bin/*java* please.
    • John Lexus
      John Lexus almost 7 years
      When I run that command, I get ls: cannot access /usr/bin/*java*: No such file or directory. Interestingly enough, when I run java -version, I get a couple of java packages, but not openjdk-8-jre
    • Redbob
      Redbob almost 7 years
      I follow this guide since times a go, it's very good: digitalocean.com/community/tutorials/…. Type "update-aternatives --display java" and you will see which versions of java are installed. So you can uninstall then by command update-alternatives --remove ...