0

How can I proceed further to install java

Environment: 16.04 Server Edision

test@ubuntu:~$ java -version

The program 'java' can be found in the following packages:
 * default-jre
 * gcj-5-jre-headless
 * openjdk-8-jre-headless
 * gcj-4.8-jre-headless
 * gcj-4.9-jre-headless
 * openjdk-9-jre-headless
Try: sudo apt install <selected package>
prem
  • 499
  • 3
    Did you read that error? It is not installed run sudo apt install default-jre – Mark Kirby Aug 31 '16 at 07:32
  • Getting this error if i run that – prem Aug 31 '16 at 07:38
  • Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 openjdk-8-jre-headless amd64 8u91-b14-3ubuntu1~16.04.1 403 Forbidden 59% [Working] Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 openjdk-8-jre-headless amd64 8u91-b14-3ubuntu1~16.04.1 403 Forbidden E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-8/openjdk-8-jre-headless_8u91-b14-3ubuntu1~16.04.1_amd64.deb 403 Forbidden

    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-m

    – prem Aug 31 '16 at 07:38
  • 1
    Please try to read the errors, run sudo apt update – Mark Kirby Aug 31 '16 at 07:45
  • Update doesn't show any error – prem Aug 31 '16 at 09:09
  • test@ubuntu:~$ sudo apt-get update Hit:1 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease Hit:2 http://in.archive.ubuntu.com/ubuntu xenial InRelease Hit:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Hit:5 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 94.5 kB in 57s (1,636 B/s) Reading package lists... Done – prem Aug 31 '16 at 09:10
  • Now you have updated successfully, run sudo apt install default-jre – Mark Kirby Aug 31 '16 at 09:14
  • Same error! i'm seeing the above which I pasted. Err:1 security.ubuntu.com/ubuntu xenial-security/main amd64 – prem Aug 31 '16 at 09:28

1 Answers1

0

Downloaded Tar jdk and updated the java path

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_79/bin/java 1

Not it showing java version.

test@ubuntu:~/elasticsearch-2.3.4$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
prem
  • 499