0

So I am trying to install Java Runtime 8 on Ubuntu Linux 14.04. I managed to get OpenJDK 7 using apt-get but I don’t see any JDK 8. I tried to download Oracle's Jre 8 .tar.gz file and I extracted it but it's just a folder. When I do java -version it shows the OpenJDK 7 which I had previously installed, no Jre 8. Please Help!

-----Edit----- xenoid I tried that, the OpenJDK 7 was using apt-get and the JRE 8 is a package. I figured out that my python packages messed up during an update and I couldn't install any more packages. I'm Reinstalling Ubuntu. (But now my computer died fully)

4
  • An empty folder? or does it contain a bin or a jre/bin directory? Did you follow this?
    – xenoid
    Commented Sep 10, 2017 at 21:38
  • No, It's Not empty. Is does contain a bin folder. And Yes I followed the page Commented Sep 14, 2017 at 14:22
  • Here is the jre offline package LINK.
    – Biswapriyo
    Commented Sep 14, 2017 at 18:16
  • Take a look here: superuser.com/questions/135580/…
    – Tech-IO
    Commented Sep 14, 2017 at 19:18

4 Answers 4

0

Your problem is that you have two Java runtimes installed, 1.7 and 1.8. Normally you would use alternatives to switch them but that assumes that both have been installed by the standard packaging methods.

The Java8 one is likely not even in your path, but you can start it using a full path:

<path-of-installation>/jre/bin/java
1

try with

sudo add-apt-repository ppa:webupd8team/java

sudo apt update; sudo apt install oracle-java8-installer

2
  • I tried to do that but i didn't work here's what i got: tima@tima-LX6810-01:~$ sudo apt install oracle-java8-installer Reading package lists... Done Building dependency tree Reading state information... Done Package oracle-java8-installer is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'oracle-java8-installer' has no installation candidate Commented Sep 11, 2017 at 14:18
  • 1
    @DiamondMiner88: Please don’t try to post multi-line comments.  Information regarding what you have tried and what results you got should go into your question, so edit your question and put them there. Commented Sep 11, 2017 at 17:09
0

It's a try, just use the correct java version number, and maybe take a look to the actual folders ?

In the bash:

ln -s /usr/java/jdk1.8.0_121/bin/java /usr/bin/java

export PATH=/usr/java/jdk1.8.0_121/bin:$PATH

export JAVA_HOME=/usr/java/jdk1.8.0_121

0

1. Download the latest Java SE SDK version.

http://www.oracle.com/technetwork/ja...ads/index.html

At the time of writing the filename and version was jdk-7u17-linux-x64.tar.gz

  1. Untar the Archive tar -xzvf /root/jdk-7u17-linux-x64.tar.gz mv jdk1.7.0_17 /opt cd /opt/jdk1.7.0_17

3.This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:

update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_17/bin/java 1 update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_17/bin/javac 1 update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so 1 update-alternatives --set java /opt/jdk1.7.0_17/bin/java update-alternatives --set javac /opt/jdk1.7.0_17/bin/javac update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so

  1. Test

To check the version of Java you are now running

java -version

To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?

1
  • 1
    Welcome to Super User. This question is several years old, and jdk8 wasn't in the Ubuntu repository at that time. Now it is. Wouldn't it be preferable to install it that way?
    – fixer1234
    Commented Mar 20, 2019 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .