• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install JAVA 8 on Ubuntu 18.04/16.04, Linux Mint 19/18

Written by Rahul, Updated on May 28, 2020

There are two standard types of installation available are JDK and JRE. JDK (Java Development Kit) provides the ability to develop a new Java application, which includes Java compiler. JRE (Java Runtime Environment) provides the runtime environment for any Java application with applets. The Java developers required to install JDK and JRE both on their system to create new Java Applications.

IMPORTANT: The Oracle Java 8 is no longer available to download publicaly. You can use below link to install Java 11. You may also continue to this tutorial to install OpenJDK 8.

  • Read this => Install Oracle Java 11 on Ubuntu 16.04 LTS (Xenial)
  • Read this => Install Oracle Java 11 on Ubuntu 18.04 LTS (Bionic)

Use this tutorial to install OpenJDK Java 8 on Ubuntu 19.10, 18.04 LTS, 16.04 LTS, LinuxMint 19, 18 using PPA. Follow the below steps to install Java 8 on Ubuntu via the command line.

Step 1 – Install Java 8 on Ubuntu

The OpenJDK 8 is available under default Apt repositories. You can simply install Java 8 on an Ubuntu system using the following commands.

Run below commands to install Java 8 on Ubuntu and LinuxMint.

sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre

Step 2 – Verify Java Installation

You have successfully installed Java 8 on your system. Let’s verify the installed and current active version using the following command.

java -version

openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1ubuntu1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Step 3 – Setup JAVA_HOME and JRE_HOME Variable

As you have installed Java on your Linux system, You must have to set JAVA_HOME and JRE_HOME environment variables, which is used by many of the Java applications to find Java libraries during runtime. You can set these variables in /etc/environment file using the following command.

cat >> /etc/environment <<EOL
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
EOL

All done, you have successfully installed Java 8 on a Linux system. You may also need to install Tomcat server to run your Java web application. Use our another tutorial to Install Tomcat 7 or Install Tomcat 8 or Install Tomcat 9 on Ubuntu, Debian, and LinuxMint systems.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

187 Comments

  1. Avatar Costin C-tin Reply
    July 21, 2020 at 6:02 am

    As Benjamin Hecht (and others) pointed out “Permission denied” is raised when trying “cat >> /etc/environment <<EOL ” . Even with “sudo cat >> ” the same applies. To be able to write to /etc/environment this needs to be used:
    cat | sudo tee -a /etc/environment <<EOL
    JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
    JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
    EOL

    • Avatar Kamsala Rajesh Reply
      September 27, 2020 at 5:19 pm

      How to upgrade or how to remove java-8 version and install java7 how to set environment variable, can anyone help me with my question?

  2. Avatar Benjamin Hecht Reply
    July 4, 2020 at 3:21 am

    Hi, I’m getting ‘permission denied’ as an error:

    (base) [email protected]:~$ java -version
    openjdk version “1.8.0_252”
    OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
    OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
    (base) [email protected]:~$ cat >> /etc/environment < JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
    > JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
    > EOL
    bash: /etc/environment: Permission denied
    (base) [email protected]:~$ cat >> /etc/environment < JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
    > JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
    > EOL
    bash: /etc/environment: Permission denied

    Any help would be greatly appreciated! Thanks! Trying to use java for loading a jnlp file so using Java 8 on 18.04.4 appears to be the only way.

    • Avatar Mattis Reply
      July 20, 2020 at 8:58 am

      Try: sudo nano /etc/environment (or use any other text editor)
      Then add the lines:
      JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
      JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre

    • Avatar sachin Kale Reply
      January 22, 2021 at 7:56 am

      add permission with below commonad
      sudo chmod -R ugo+rw /etc/environment

  3. Avatar Levent GUREN Reply
    May 27, 2020 at 10:37 pm

    There is a space after equal sign at this line:
    JAVA_HOME= /usr/lib/jvm/java-8-openjdk-amd64
    This must not be there. 🙂

    • Rahul Rahul Reply
      May 28, 2020 at 4:21 am

      Thanks Levent, Article has been updated.

  4. Avatar José Reply
    May 1, 2020 at 2:54 pm

    thanks!

  5. Avatar Nicodemus Ojwee Reply
    March 3, 2020 at 2:50 pm

    Thanks for the quick and clear guide.

  6. Avatar Marcus Siqueira Reply
    February 11, 2020 at 6:59 pm

    Interesting stuff! Keep the site up you have a lot of good content! You just helped me and I believe you helped a lot more people

  7. Avatar sabung ayam s128 Reply
    February 5, 2020 at 7:04 pm

    Good write-up. I certainly love this website. Thanks!

  8. Avatar pharaprince Reply
    January 24, 2020 at 1:42 am

    Thanks it worked for me

  9. Avatar Hugo Reply
    January 4, 2020 at 12:51 am

    Step 2 still says “Oracle Java 8”

    • Rahul Rahul Reply
      January 4, 2020 at 4:28 am

      Hi Hugo, Thanks for pointing it. I have updated the tutorial correctly.

  10. Avatar Łukasz Przesmycki Reply
    November 23, 2019 at 1:00 pm

    This is not an Oracle JDK installation as the title suggest!

    • Rahul Rahul Reply
      November 25, 2019 at 10:11 am

      I have corrected the title. Earlier this tutorial was for the Oracle Java installation, But as of now, Oracle Java 8 is not available directly, So we change it to OpenJDK.

  11. Avatar Sen Reply
    October 31, 2019 at 11:49 am

    This works perfectly as of 31-Oct-2019

  12. Avatar Ashish Reply
    October 8, 2019 at 8:56 am

    Working perfectly

  13. Avatar Sathishkumar Reply
    September 5, 2019 at 7:07 am

    Hi, I’m using Ubuntu 18.04 and I’m getting below error :

    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

    • Avatar Alison Reply
      September 23, 2019 at 9:14 pm

      This article is out of date, and, as of September 2019, no longer works.

  14. Avatar Shivdas Kanade Reply
    August 2, 2019 at 9:33 am

    very easy steps. Thanks

  15. Avatar Edwin Smith Velandia Salazar Reply
    June 6, 2019 at 4:05 pm

    work for me,

    sudo apt-get install default-jdk
    sudo apt autoremove
    sudo apt-get install default-jre
    java –version
    sudo apt install openjdk-8-jdk

    sudo update-alternatives –config java
    Existen 2 opciones para la alternativa java (que provee /usr/bin/java).

    Selección Ruta Prioridad Estado
    ————————————————————
    0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 modo automático
    1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 modo manual
    * 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 modo manual

    Pulse para mantener el valor por omisión [*] o pulse un número de selección:

    *** in my case, i used java-8, press 2

    and my app work.

    • Avatar Jonathan Reply
      October 21, 2019 at 5:11 pm

      worked on LinuxMint. Thanks

  16. Avatar Jignesh Reply
    May 31, 2019 at 4:39 pm

    It’s not working and it won’t work. You need to update your article. Oracle has made it mandatory to create an account and download the required version. The PPA method is deprecated and it won’t work.

    TIP: Make sure you download the binary version or the Oracle 8 JDK.

  17. Avatar sirius2834 Reply
    May 29, 2019 at 9:50 am

    Actually it is possible to install Java 8 u 131 to Mint 19+ or Ubuntu 18+.

    Search for these files on the Internet:

    oracle-java8-installer_8u131-1_webupd8_2_all.deb
    oracle-java8-set-default_8u131-1_webupd8_2_all.deb
    oracle-java8-unlimited-jce-policy_8u131-1_webupd8_2_all.deb

    Then:

    sudo oracle-java8-installer_8u131-1_webupd8_2_all.deb
    sudo oracle-java8-set-default_8u131-1_webupd8_2_all.deb
    (and you can install the unlimited one, but not necessary by defalut)

    In contrary to the abandoned PPA, you can install these without problems and the ‘Oracle Java 8 Plugin Control Panel’ will work too.

    If the .jnlp files don’t open in Firefox, then select “open with” and enter “javaws” .

    There is virtually no info of Java 8 for the latest Mint/Ubutu installation over the internet and I had to figure it out too.

    I hope it helps!

    • Rahul Rahul Reply
      May 31, 2019 at 6:40 am

      Hi,

      Java 8 is no more available to download from Oracle site. But if you have any existing installation on another system, can be used to install to your system.

  18. Avatar Harshit Reply
    May 2, 2019 at 2:02 pm

    This is not working. It is showing this error E: Package ‘oracle-java8-installer’ has no installation candidate

    • Avatar Vsevolod Reply
      May 7, 2019 at 7:27 am

      because oracle changed license for it’s jdk. this tutor is useless and, in fact, scam.

  19. Avatar krishna Reply
    April 29, 2019 at 9:38 am

    Hi
    when i try to intall the java8. By these commands
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt update; sudo apt install oracle-java8-installer
    after the second command i am getting error like this
    “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”
    what to do ? and i have tried everything to come out of this i can’t able to do this
    plzz help me out.

  20. Avatar Va Sja Reply
    April 28, 2019 at 4:06 pm

    Unfortunately don’t work anymore 🙁
    >
    >~/Downloads/jdk1.8.0_202$ sudo apt-get install oracle-java8-set-default
    >[sudo] password for i1:
    >Reading package lists… Done
    >Building dependency tree
    >Reading state information… Done
    >E: Unable to locate package oracle-java8-set-default

  21. Avatar Chuanpeng Hu Reply
    April 17, 2019 at 8:29 pm

    Hi, there,

    Thanks so much for your post. It’s helpful.
    But I failed to install java,

    > sudo apt install oracle-java11-installer

    I got this error message:

    Resolving login.oracle.com (login.oracle.com)… 209.17.4.8
    Connecting to login.oracle.com (login.oracle.com)|209.17.4.8|:443… connected.
    HTTP request sent, awaiting response… 401 Authorization Required

    Username/Password Authentication Failed.
    download failed
    Oracle JDK 8 is NOT installed.
    dpkg: error processing package oracle-java8-installer (–configure):
    installed oracle-java8-installer package post-installation script subprocess returned error exit status 1
    Processing triggers for shared-mime-info (1.9-2) …
    Setting up oracle-java11-set-default (11.0.2-2~linuxuprising1) …
    Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) …
    Processing triggers for hicolor-icon-theme (0.17-2) …
    Processing triggers for fontconfig (2.12.6-0ubuntu2) …
    Errors were encountered while processing:
    oracle-java8-installer
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    One possibility is that “401 is because 8u211 is the first version that is paid only. The previous 8u201 was the last freely available version.” as suggested by one comment here: https://stackoverflow.com/questions/46815897/jdk-8-is-not-installed-error-404-not-found

  22. Avatar Neha Reply
    March 15, 2019 at 11:36 am

    I need jdk version to be like this

    Java version “1.8.0_40”
    Java™ SE Runtime Environment (build 1.8.0_40-b25)
    Java HotSpot™ 64-Bit Server VM (build 25.40-b25, mixed mode)

    How do I do it for Ubuntu 18.10

  23. Avatar Alexandre Pedro Reply
    February 17, 2019 at 6:58 pm

    Linux Mint 19.1, couldn’t do the last step as the guide says. Ended up doing:
    sudo nano /etc/environment

    Paste in:
    JAVA_HOME=/usr/lib/jvm/java-8-oracle
    JRE_HOME=/usr/lib/jvm/java-8-oracle/jre

    Save and exit.

    Thank you for the guide!

    • Avatar Joshua Reply
      February 22, 2019 at 1:37 pm

      Same here.

  24. Avatar Ram Reply
    January 19, 2019 at 12:23 pm

    This is simple and extremely easy explanation

  25. Avatar Veda Reply
    July 8, 2018 at 5:26 pm

    But live-streaming of the game can affect their job and makes these enjoy theirs favored game on laptop or pc.

  26. Avatar Ramonita Reply
    May 31, 2018 at 4:10 pm

    If they bests the seller he gets twice the total amount
    of money inside the payout than he’d have if he had gained without doubling.

  27. Avatar scott Reply
    March 24, 2018 at 11:56 am

    Location: http://download.oracle.com/otn-pub/?AuthParam=1521892631_53f4fd9f2a836d690ba6d31c8b160b91 [following]
    –2018-03-24 11:55:11– http://download.oracle.com/otn-pub/?AuthParam=1521892631_53f4fd9f2a836d690ba6d31c8b160b91
    Connecting to download.oracle.com (download.oracle.com)|2.21.188.165|:80… connected.
    HTTP request sent, awaiting response… 404 Not Found
    2018-03-24 11:55:12 ERROR 404: Not Found.

    • Rahul Rahul K. Reply
      March 25, 2018 at 2:28 am

      Hi Scott,

      I have checked commands and this is working for me. Which operating system version are you using?

  28. Avatar vanderlei Reply
    March 4, 2018 at 10:42 pm

    W: Falhou ao buscar http://archive.ubuntu.com/ubuntu/dists/vivid-backports/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80]

  29. Avatar vanderlei Reply
    March 4, 2018 at 10:39 pm

    sudo apt-get install oracle-java8-installer
    sudo: não foi possível resolver máquina leni
    Lendo listas de pacotes… Pronto
    Construindo árvore de dependências
    Lendo informação de estado… Pronto
    Alguns pacotes não puderam ser instalados. Isto pode significar que
    você solicitou uma situação impossível ou, se você está usando a
    distribuição instável, que alguns pacotes requeridos não foram
    criados ainda ou foram retirados da “Incoming”.
    A informação a seguir pode ajudar a resolver a situação:

    Os pacotes a seguir têm dependências desencontradas:
    oracle-java8-installer : Depende: java-common (>= 0.24) mas não é instalável
    Recomenda: gsfonts-x11 mas não é instalável
    Recomenda: oracle-java8-set-default mas não será instalado
    E: Impossível corrigir problemas, você manteve (hold) pacotes quebrados.

  30. Avatar Ankit Tiwari Reply
    January 22, 2018 at 8:36 am

    Hello

    Connecting to download.oracle.com (download.oracle.com)|104.122.105.69|:80… connected.
    HTTP request sent, awaiting response… 404 Not Found
    2018-01-22 13:59:51 ERROR 404: Not Found.

    download failed
    Oracle JDK 8 is NOT installed.
    dpkg: error processing package oracle-java8-installer (–configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    oracle-java8-installer
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    I am getting this error while running install command on terminal on linux mint 17.2.

    • Rahul Rahul K. Reply
      January 22, 2018 at 10:23 am

      Hi Ankit, The webupd8 team has not updated the package yet to PPA. For the time, You can download packages to install Java 8.

      https://drive.google.com/file/d/1l8NTWhZrwYjvjRMXvAgTNXbExJ08eIjU/view

  31. Avatar Bill Schwob Reply
    January 20, 2018 at 6:41 pm

    when i do this all i get is

    download failed
    Oracle JDK 8 is NOT installed.
    dpkg: error processing package oracle-java8-installer (–configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    oracle-java8-installer
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    • Rahul Rahul K. Reply
      January 22, 2018 at 10:23 am

      Hi Bill, The webupd8 team has not updated the package yet to PPA. For the time, You can download packages to install Java 8.

      https://drive.google.com/file/d/1l8NTWhZrwYjvjRMXvAgTNXbExJ08eIjU/view

  32. Avatar Nathan Reply
    January 18, 2018 at 12:17 am

    Great information. Appreciate the time you took to share this feedback for us computer nerds. Love your blog too. Java is still one of the best options out there.

  33. Avatar Jari Reply
    September 19, 2017 at 4:47 pm

    step 1 Can do add-apt-repository ppa:webupd8team/java && apt-get update && apt-get install oracle-java8-installer allso little bit easy 🙂

  34. Avatar BK Reply
    August 12, 2017 at 11:25 pm

    hi,
    there is an error with python-samba while installing oracle-java8-installer.
    [/var/cache/apt/archives/python-samba_2%3a4.3.11+dfsg-0ubuntu0.16.04.9_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)]
    how can i solve this problem?

  35. Avatar tullio Reply
    July 26, 2017 at 7:04 pm

    i’m not being able to edit the etc/environment file!!!
    please help?!

    • Avatar Icthyo Reply
      August 3, 2017 at 2:23 am

      Hello:

      You you either open ‘Files’ or ‘nautilus’ with root privileges, you will be able to open the etc/environment file, edit it and save afterward.

    • Avatar Armando Reply
      September 6, 2017 at 6:56 pm

      the easiest way is to do it through the terminal using sudo for root access (which enables you to edit sensitive files)
      $ sudo gedit /etc/environment
      add the lines
      then save.
      done.

  36. Avatar Tim Cooper Reply
    December 28, 2016 at 8:20 pm

    This seems to install JRE _not_ JDK as the title of the article states.
    Several people have pointed this out in the comments yet these queries remain unanswered.
    Perhaps the title of the article is incorrect…

    • Rahul Rahul K. Reply
      December 29, 2016 at 5:28 am

      Hi Tim,

      This installs JDK and JRE both. After installation you can check install java compiler.

      $ javac -version

      javac 1.8.0_111

  37. Avatar Jeff Reply
    October 28, 2016 at 4:35 pm

    Thank you! This works Great! I was also able to integrate Apache Solr on my website

    I am thinking about keeping this up and going on my vps server

  38. Avatar meya Reply
    August 12, 2016 at 9:08 pm

    Hello, i f i understand this will install JDK too. But i cant find my JDK directory.
    any help or explanation ? thank you in advance

    • Avatar ilium007 Reply
      September 1, 2016 at 1:41 am

      I didn’t get a JDK downloaded either. Does anyone have a suggestion ?

  39. Avatar JeanAlesi Reply
    August 11, 2016 at 9:27 pm

    I don’t like it.. It’s too easy.
    Do you have a harder example?

  40. Avatar vikas avnish Reply
    August 7, 2016 at 7:18 pm

    This is simple and extremely easy explanation

  41. Avatar tiago Reply
    August 7, 2016 at 2:53 am

    I want know becouse we make donwload of archive on site of oracle and that file i dont can install

  42. Avatar Nikolaj Reply
    August 4, 2016 at 11:31 am

    1-up!!! Thanks! you saved my day 🙂

  43. Avatar Samuele Soraggi Reply
    July 29, 2016 at 10:15 pm

    Thanks for your suggestions, this solution is fast and understandable. i owe you one 😀

  44. Avatar Gustavo Chavarro Ortiz Reply
    July 21, 2016 at 3:29 am

    that is the best guide of the INTERNET, thanks man.

  45. Avatar Pavel Reply
    July 16, 2016 at 4:23 am

    Thank you maaaan!

  46. Avatar john Reply
    July 14, 2016 at 9:54 pm

    I’ve installed java 1.8 on two devices thanks to this beautiful simple process

  47. Avatar Barry Reply
    July 10, 2016 at 4:22 pm

    🙂 you da man thanks!

  48. Avatar Chukwuemeka Reply
    July 9, 2016 at 7:00 pm

    Great guide.
    Thanks!

  49. Avatar Manjunath Reply
    July 5, 2016 at 11:26 am

    If you get “Cannot add PPA ‘ppa:cooperjona/lightread’ . Please check that the PPA name or format is correct.” error

    sudo -E add-apt-repository ppa:ppaname/ppa
    instead of

    sudo add-apt-repository ppa:ppaname/ppa

  50. Avatar xiaoguang Reply
    July 1, 2016 at 12:57 pm

    thanks

  51. Avatar Cristian Leal Reply
    June 26, 2016 at 4:43 pm

    Genio, muchas gracias. Saludos desde Argentina!

  52. Avatar il0v3tweakS Reply
    June 23, 2016 at 7:00 pm

    This saved my day! Thank you!

  53. Avatar Fredah Reply
    June 20, 2016 at 3:13 pm

    This saved me a whole day of manually doing it myself. Thanks so much!!

  54. Avatar Melinda Reply
    May 25, 2016 at 8:48 pm

    Great step-by-step process document!! Thanks.

  55. Avatar brucewayne Reply
    May 7, 2016 at 2:57 pm

    thanks!

  56. Avatar Luis Felipe Reply
    May 3, 2016 at 5:21 pm

    Thanks a lot! You all helped me a lot!

  57. Avatar deva Reply
    May 3, 2016 at 10:30 am

    nice documentation

  58. Avatar sue Reply
    April 30, 2016 at 10:43 pm

    i already had java7. after installing java8, java- -version still gives jdk7… whats the solution?

    • Avatar vamsi Reply
      January 30, 2019 at 10:49 am

      have u got any solution? for this ….

  59. Avatar Z06R8CR Reply
    April 29, 2016 at 9:42 pm

    Thanks for the great instructions!

  60. Avatar Jonatas Reply
    April 29, 2016 at 3:18 pm

    Thank you !

  61. Avatar Benedito Sene Reply
    April 28, 2016 at 11:07 pm

    Thank you very much !!

  62. Avatar prathinma Reply
    April 19, 2016 at 5:37 am

    Thank You so much

  63. Avatar Max Reply
    April 17, 2016 at 8:19 pm

    Thank bro none of the site help out on google but u r site instruction was extremely perfect….

  64. Avatar Mrunal Reply
    April 13, 2016 at 10:34 am

    This article was extremely helpful. Please keep posting Linux and Java related articles.

  65. Avatar Gustavo Zaera Holo Reply
    March 12, 2016 at 8:18 pm

    Thanks for a simple and great HOWTO! 🙂

  66. Avatar srinidhi Reply
    February 25, 2016 at 7:28 am

    hi guys i am getting this error)
    (http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-i586.tar.gz
    Connecting to download.oracle.com (download.oracle.com)|180.149.61.152|:80… connected.
    HTTP request sent, awaiting response… Read error (Connection reset by peer) in headers.
    Retrying.)
    upto try:5 after that download fail NOT inst error please help

    • Avatar tohuuu Reply
      March 30, 2016 at 9:43 am

      Encountered the same issue – i had to modify the timeout settings in /var/lib/dpkg/info/oracle-java8-installer.postinst to make it run. Sadly, the installer script doesn’t use the system-wide /etc/wgetrc but creates its own wgetrc each time it runs. So, you’ll have to search for the line “echo “timeout = 15″ >> wgetrc” in the postinst file i’ve mentioned above. Now, just set a longer timeout or remove the line completely.

  67. Avatar shravan Reply
    February 22, 2016 at 3:37 am

    Thank you very much

  68. Avatar ubBa Reply
    February 16, 2016 at 6:19 pm

    It is not working for me.

    • Rahul Rahul Reply
      February 17, 2016 at 4:54 am

      Hi,

      What issue are you facing ?

  69. Avatar Eduardo Reply
    February 14, 2016 at 1:37 pm

    Thanks man. It works perfectly.

  70. Avatar Luis Reply
    February 4, 2016 at 4:33 pm

    Muy útil, muchas gracias.

  71. Avatar Jaswant Reply
    January 26, 2016 at 2:54 pm

    Very useful tutorial…

  72. Avatar Aradhya Sen Reply
    January 26, 2016 at 2:35 pm

    Thank you

  73. Avatar Manurmu Reply
    January 26, 2016 at 5:07 am

    hey!!! so usefull!!!! thank a lot!!!!! 😀

  74. Avatar Michael Reply
    January 26, 2016 at 4:34 am

    Thanks dude searched everywhere for guides but yours is the best and easiest.

  75. Avatar PRESIDENT Reply
    January 24, 2016 at 8:55 am

    Thank you 😉

  76. Avatar Ananda Bayu Reply
    January 7, 2016 at 10:24 am

    Hey, i’am new with linux and its very usefull thanks for the tutorial.

  77. Avatar Tanja Reply
    January 5, 2016 at 5:43 pm

    Thank you very much for this. It helped a lot!

  78. Avatar Ian Reply
    December 30, 2015 at 7:21 pm

    I’m getting an error when running the command:

    sudo add-apt-repository ppa:webupd8team/java

    The error is:
    Cannot add PPA: ‘ppa:~webupd8team/ubuntu/java’.
    ERROR: ‘~webupd8team’ user or team does not exist.

    • Rahul Rahul Reply
      December 31, 2015 at 9:55 am

      Hi Ian,

      Its still working for me. Please confirm what OS version are you using ?

  79. Avatar lanowar Reply
    December 26, 2015 at 5:55 pm

    Thanks but it’s not working for me, this is the message i got:

    ~ $ sudo apt-get update
    E: Type ‘sudo’ is not known on line 1 in source list /etc/apt/sources.list.d/mono-xamarin.list
    E: The list of sources could not be read.

  80. Avatar nicolas Reply
    December 14, 2015 at 9:04 pm

    Very nice, simple and useful

  81. Avatar Allen Burns Reply
    December 9, 2015 at 7:52 pm

    Sure wish this wasn’t the first item coming up in a google search of “installing java 8 jdk on ubuntu” because this isn’t the jdk!

    • Avatar ZAID BOUDAMOUZ Reply
      December 18, 2015 at 7:08 pm

      I agree with you comment !!! It’s not a JDK and only a Runtime then, no option to compile (no javac compiler)

  82. Avatar IZVITE Reply
    December 7, 2015 at 10:19 am

    Thanks a lot!

  83. Avatar Zacknov Reply
    December 5, 2015 at 2:24 pm

    Nice article. So the reference in my blog yes

  84. Avatar Bharath Reply
    November 25, 2015 at 10:19 am

    Thanks a lot

  85. Avatar java Reply
    November 21, 2015 at 12:24 pm

    thanks

  86. Avatar Pracaonline Reply
    November 14, 2015 at 12:09 am

    Thanks for that short advice, for now everything is working 😉 and let it stay in this way 😉

  87. Avatar qwerty Reply
    October 29, 2015 at 9:45 am

    Thank you!

  88. Avatar kevin Reply
    October 28, 2015 at 2:27 am

    thank, ..thank you very much, very nice work

  89. Avatar Miguel Reply
    October 25, 2015 at 12:09 am

    Very Nice, thanks!

  90. Avatar yogesh Reply
    October 22, 2015 at 5:04 pm

    you follow this post and enjoy java8. very nice work done by techadmin.

  91. Avatar Gabriel Reply
    October 19, 2015 at 5:40 am

    Thanks dude ° this information was util.

  92. Avatar Gaspar Reply
    October 13, 2015 at 12:14 pm

    Good job!

  93. Avatar Zvonimir Reply
    October 12, 2015 at 3:13 pm

    Does not work trows class not found exception

  94. Avatar Yogendra Reply
    October 6, 2015 at 2:14 am

    everything went in a breeze – cool
    thanks
    looking for manual procedure to do stepbystep as well

  95. Avatar Mohammad Dashti Reply
    September 30, 2015 at 4:17 pm

    Thanks a lot.
    Very helpful.

  96. Avatar Steve Reply
    September 30, 2015 at 1:59 pm

    Thanks man!! Worked like a champ!

  97. Avatar Elvir Reply
    September 16, 2015 at 2:10 am

    Muito obrigado amigo.

  98. Avatar bdnahomi Reply
    August 31, 2015 at 1:06 am

    Thank you very useful

  99. Avatar Sergio Reply
    August 25, 2015 at 12:22 am

    Thanks

  100. Avatar Gurbachan Singh Reply
    August 21, 2015 at 1:37 pm

    While installing throw sha256sum mismatch jdk-8u60-linux-x64.tar.gz

    please help me to out this problem

  101. Avatar Vinit Reply
    August 20, 2015 at 1:27 pm

    Thank you so much……Really really helped alot….. 🙂

  102. Avatar David G. Pickett Reply
    August 18, 2015 at 9:49 pm

    Is there a way to get it to move up from 51 to 60? The website says I am behind!

  103. Avatar nelson molina Reply
    August 18, 2015 at 12:46 am

    Thanks very thamkful!!

  104. Avatar Yura Reply
    August 7, 2015 at 9:12 pm

    Really helpful information.

  105. Avatar Bala Reply
    August 5, 2015 at 2:07 pm

    Good One!

  106. Avatar Leenie Reply
    August 2, 2015 at 2:49 pm

    Webupd8 Java PPA DOWN!!!!! When will it be updated?

    W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ppa.launchpad.net trusty Release: The following signatures were invalid: BADSIG C2518248EEA14886 Launchpad VLC

    W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/trusty/Release

    W: Some index files failed to download. They have been ignored, or old ones used instead.

  107. Avatar sumit Reply
    July 22, 2015 at 2:59 pm

    thankyou somuch

  108. Avatar BPatient Reply
    June 24, 2015 at 10:36 am

    Thank you sharing a such helpful article

  109. Avatar Aaron Reply
    June 22, 2015 at 7:44 pm

    idk how to install this

  110. Avatar Harshita Reply
    June 12, 2015 at 6:02 am

    Hi Rahul,
    I am new to Ubuntu. I tried the setps to install jdk 1.8.
    While setting environment, I found the error
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/rt.pack
    jsse.jar…
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/jsse.pack
    charsets.jar…
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/charsets.pack
    localedata.jar…
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/ext/localedata.pack
    jfxrt.jar…
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/ext/jfxrt.pack
    plugin.jar…
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/plugin.pack
    javaws.jar…
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/javaws.pack
    deploy.jar…
    Error: Could not open input file: /usr/java/jre1.8.0_45/lib/deploy.pack
    /var/lib/dpkg/info/jre1.8.0-45.postinst: line 641: /usr/sbin/alternatives: No such file or directory
    dpkg: error processing package jre1.8.0-45 (–configure):
    subprocess installed post-installation script returned error exit status 127
    Setting up oracle-java8-set-default (8u45+8u33arm-1~webupd8~1) …
    Errors were encountered while processing:
    jre1.8.0-45
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    What should I do to set environment ?

    • Avatar Zoli1972 Reply
      July 21, 2015 at 5:25 pm

      Same here, HARSHITA.

      Worse: I can’t install any package since I’ve tried to install this using this tutorial. Can someone help please?

      Zoli

      • Avatar Zoli1972 Reply
        July 21, 2015 at 5:44 pm

        EDIT: Maybe a helpful hint, I did a…

        java -version

        …this shows me…

        java version “1.9.0-ea”
        Java(TM) SE Runtime Environment (build 1.9.0-ea-b70)
        Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b70, mixed mode)

        So the error messages seem to come from an older installation, that I have to remove. But how?

        Zoli

  111. Avatar Sohan Reply
    June 8, 2015 at 11:43 am

    Very helpful article.

  112. Avatar Sergio Reply
    June 1, 2015 at 6:01 pm

    Very helpful,

    Thanks !!!

  113. Avatar Luigi Reply
    May 27, 2015 at 4:29 pm

    Very helpful article. Thanks.

  114. Avatar Amit Reply
    May 26, 2015 at 11:09 pm

    Hi,

    I would like to thank you for helping the non techs like myself first. Could you help me with a problem I get? I am using LM 17.1 and trying to do the installation I get the Binary Code License Agreement display at mt terminal window. There is no way to click ok or accept those terms, failing which the installation aborts. Can you tell me a way around, or what am I doing wrong?

    Thanks
    Amit

    • Avatar pritis Reply
      October 8, 2015 at 9:59 am

      use arrow keys to move, enter to accept

  115. Avatar Os Reply
    May 22, 2015 at 9:35 pm

    Thank you!! It works!.

  116. Avatar MARCELO Reply
    May 5, 2015 at 3:21 pm

    Thanks for the info! very helpful…

  117. Avatar reshma Reply
    May 4, 2015 at 10:46 am

    Thank you so much, this helped a lot !!!!

  118. Avatar Javild Reply
    April 24, 2015 at 6:35 pm

    Thanks from a spanish user!

  119. Avatar Rana Reply
    April 13, 2015 at 5:48 am

    Thanks! It helped a lot!

  120. Avatar habdul Reply
    April 10, 2015 at 6:46 pm

    if i search, do i have java?, and enter site is says this plugin is not accepted,what i have to do?

    • Rahul Rahul Reply
      April 11, 2015 at 3:20 am

      Hi Habdul,

      Do you mean java is working with browser ? If yes which browser are you using ?

  121. Avatar NoSyu Reply
    January 6, 2015 at 7:02 am

    Thank you for kind article to install java 1.8 in Ubuntu 14.04.
    It works well. 🙂

  122. Avatar Abdul Hannan Reply
    January 4, 2015 at 4:51 pm

    Will it work for Ubuntu 14.10?

  123. Avatar Jim Somerville Reply
    December 28, 2014 at 12:51 am

    This is very handy, thank you. And thank you to the Webupd8 Team!

  124. Avatar carlos Reply
    December 22, 2014 at 2:56 pm

    thank you, greetings from México.

  125. Avatar Satya Prakash Joshi Reply
    December 17, 2014 at 2:04 pm

    You made my day,, thanks allot

  126. Avatar Zoltan Reply
    December 13, 2014 at 6:21 pm

    Hi,
    I could install java 8 as you wrote, but I still can not set java 8 as a default JRE. And when I would like to add it to the installed JREs I cant find it. Where should it be?
    Thank you!

  127. Avatar tendertree Reply
    December 3, 2014 at 11:53 am

    thanks for post !! it was very helpful for me !

  128. Avatar Avinash Reply
    November 30, 2014 at 10:55 am

    Thanks for the guide.. worked fine for me

  129. Avatar Nerunja Reply
    November 29, 2014 at 3:18 am

    Thank you very much. This is really helpful.

  130. Avatar Kevin Reply
    November 26, 2014 at 12:11 pm

    Awesome! very helpful!

  131. Avatar Tiru Reply
    November 23, 2014 at 6:06 pm

    Very useful. Thank you.

  132. Avatar Davi Lima Reply
    November 17, 2014 at 7:57 pm

    Very Easy for install Java in Ubuntu 🙂
    Nice Job

  133. Avatar Marcio Reply
    November 11, 2014 at 3:57 pm

    great! i always wonder why we haven’t something like a repo to install jdk!

    great work

  134. Avatar Erwin Reply
    November 10, 2014 at 11:58 am

    Thanks a lot. Quick, easy and it installs both JDK and JRE version 8!

  135. Avatar Divine Martins Jr. Reply
    November 1, 2014 at 1:39 pm

    Wonderful and helpful.
    A written tutorial on how to install using the already downloaded tar.gz file will be helpful too. Thanks

  136. Avatar Ruben Reply
    October 29, 2014 at 8:39 pm

    This installs the JRE not the JDK/SDK. Is not the same ….

  137. Avatar Victor Reply
    October 28, 2014 at 4:17 pm

    Nice tutorial!
    But now, How do you uninstall it?

    • Avatar Tiru Reply
      November 23, 2014 at 6:14 pm

      Packages can be removed with
      >sudo apt-get –purge remove packageName

      apt-get remove may some times leave behind some files.
      –purge will remove all files.

  138. Avatar Telepath Reply
    October 24, 2014 at 9:34 pm

    Hi, whish all of costum installs have these very good install help,
    saves lots of time , thx,

  139. Avatar PK Reply
    October 21, 2014 at 12:24 am

    Hi,

    I am getting an error stating the following. Please help.

    Cannot add PPA: ‘ppa:webupd8team/java’.
    Please check that the PPA name or format is correct.

    • Avatar Telepath Reply
      October 24, 2014 at 9:36 pm

      no problem here with sudo, name (and all further instructions are correct)

    • Avatar Hi Reply
      December 12, 2014 at 4:58 pm

      Yeah.. same problem here

  140. Avatar Jeroen Reply
    October 6, 2014 at 9:09 pm

    Thanks man, saved me some time 🙂

  141. Avatar ceghap Reply
    September 26, 2014 at 11:26 am

    thanks! 🙂

  142. Avatar BlastedChango Reply
    September 22, 2014 at 8:19 pm

    Thank you very much, this helped a lot

  143. Avatar Alan Reply
    September 22, 2014 at 2:29 am

    Very good, help so much

  144. Avatar bigspawn Reply
    September 20, 2014 at 1:12 pm

    Thank’s for this article!

  145. Avatar Elias Reply
    September 18, 2014 at 6:35 pm

    Thanks! Very helpful.

  146. Avatar mike Reply
    September 13, 2014 at 9:42 pm

    you guys rock

  147. Avatar Dery Reply
    September 12, 2014 at 10:07 pm

    Thank you so much!

  148. Avatar Victor Reply
    September 8, 2014 at 6:51 pm

    Thank you!

  149. Avatar eyescream Reply
    August 31, 2014 at 10:07 pm

    thank you very very much

  150. Avatar juju Reply
    August 23, 2014 at 7:46 pm

    Missing the – in java -version

    • Avatar juju Reply
      August 23, 2014 at 7:47 pm

      Woops! Retract that!

  151. Avatar magma Reply
    August 22, 2014 at 6:40 pm

    many thanks, this helped a lot!

  152. Avatar pedro Reply
    July 25, 2014 at 2:51 am

    Thanks!
    I can´t access my bank with open-jdk, only with oracle-java

  153. Avatar Madhu Reply
    July 22, 2014 at 7:45 am

    Useful Information, Thanks

  154. Avatar Nestor Octavio Reply
    July 9, 2014 at 4:11 pm

    Nice tutorial
    Greetings from Mexico Wey!! :3

  155. Avatar arxos Reply
    June 24, 2014 at 6:32 am

    Thanks!!!! God Thanks!!!!

  156. Avatar wei-ting Reply
    June 1, 2014 at 8:58 pm

    Hi, these information is very useful. Thank you very much.

Leave a Reply Cancel reply

Popular Posts

  • How to View or List Cron Jobs in Linux
  • How to Install PHP 8 on Ubuntu 20.04
  • How to Set Up SSH Tunnel with PuTTY
  • How to Install MySQL 8.0 on Ubuntu 20.04
  • Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”
  • How to Install Tor Browser on Ubuntu 20.04
  • How to Allow Remote Connections to MySQL
  • How To Install VNC Server on Debian 10
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy