How to solve 'Oracle JDK 8 is NOT installed.' error, even though I have installed it before?

12,397

Solution 1

Thanks, after searching on Internet i solved my problem:

  1. I removed 'ppa:webupda8team/java' apt repository in software and update(press--> Superuser key-->type in the search 'software and update'-->'other software' tab-->remove the 'ppa:webupda8team/java' from list

  2. then i checked the source.list file to remove if any 'ppa:webupda8team/java' is exist using:

    sudo nano /etc/apt/source.list

  3. i also checked the source.list.d directory for removing java ppa file using :

    sudo rm -i /etc/apt/source.list.d/webupda8team

  4. then i update the repository using :

    sudo apt-get update

Solution 2

If you installed Java by a different method, and you are happy with your Java setup, then remove the webupda8 PPA that is causing errors:

sudo add-apt-repository -r ppa:webupd8team/java

Then run

sudo apt update
Share:
12,397

Related videos on Youtube

reza sohrabi
Author by

reza sohrabi

programmer, web developer and software engineer

Updated on September 18, 2022

Comments

  • reza sohrabi
    reza sohrabi over 1 year

    I have Java on my Ubuntu 16.04 system, but every time I try to install a program / package I get an error:

    Do you want to continue? [Y/n] y
    Setting up oracle-java8-installer (8u131-1~webupd8~2) ...
    Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
    Downloading Oracle Java 8...
    --2017-08-14 19:20:07--  http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
    Resolving download.oracle.com (download.oracle.com)... 188.43.76.48, 188.43.76.74
    Connecting to download.oracle.com (download.oracle.com)|188.43.76.48|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2017-08-14 19:20:08 ERROR 403: Forbidden.
    
    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)
    

    How can I fix this?

    • Zanna
      Zanna over 6 years
      How do you know you have installed Oracle Java 8? How did you install it? The installer from webupd8's java PPA doesn't think you have...
    • reza sohrabi
      reza sohrabi over 6 years
      @zanna I downloaded it from a site and installed it using terminal and even i set home variables, then made it the default Java on system, also javac 1.8.0_141 command returns '' javac 1.8.0_141 and java version "1.8.0_141" Java(TM) SE Runtime Environment (build 1.8.0_141-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode) but ubuntu cannot know it!