Ubuntu – Error while setting up jdk8 on Ubuntu 14.04LTS

ppasoftware installation

i was trying to setup jdk 8 using this guide.
After downloading the jdk i got an error that asked me to manually configure dpkg.

adeen-s@adeen-s-PC:~$ sudo dpkg --configure -a
Setting up oracle-java8-installer (8u66+8u65arm-1~webupd8~1) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u66-linux-x64.tar.gz
Removing outdated cached downloads...
mv: cannot move ‘jdk1.8.0_66’ to ‘java-8-oracle/jdk1.8.0_66’: Directory not empty
dpkg: error processing package oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java8-set-default:
 oracle-java8-set-default depends on oracle-java8-installer; however:
  Package oracle-java8-installer is not configured yet.

dpkg: error processing package oracle-java8-set-default (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 oracle-java8-installer
 oracle-java8-set-default

How do i fix this ?

UPDATE : Tried installing again after following @A.B. 's advice.
here's the output –>

2015-11-25 17:56:08 (50.3 KB/s) – ‘jdk-8u66-linux-x64.tar.gz’ saved [181287376/181287376]

Download done.
Removing outdated cached downloads…
install: cannot stat ‘javaws-wrapper.sh’: No such file or directory
dpkg: error processing package oracle-java8-installer (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java8-set-default:
oracle-java8-set-default depends on oracle-java8-installer; however:
Package oracle-java8-installer is not configured yet.

dpkg: error processing package oracle-java8-set-default (–configure):
dependency problems – leaving unconfigured
Errors were encountered while processing:
oracle-java8-installer
oracle-java8-set-default

UPDATE : Output after sudo apt-get purge oracle-java8-installer

adeen-s@adeen-s-PC:~$ sudo apt-get purge oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  oracle-java8-installer* oracle-java8-set-default*
0 upgraded, 0 newly installed, 2 to remove and 542 not upgraded.
2 not fully installed or removed.
After this operation, 167 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 165086 files and directories currently installed.)
Removing oracle-java8-set-default (8u66+8u65arm-1~webupd8~1) ...
Purging configuration files for oracle-java8-set-default (8u66+8u65arm-1~webupd8~1) ...
Removing oracle-java8-installer (8u66+8u65arm-1~webupd8~1) ...
Purging configuration files for oracle-java8-installer (8u66+8u65arm-1~webupd8~1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...

Best Answer

  • You have used both possibilities to install Oracle Java

    Delete the folder and start the installation again:

    sudo rm -r /usr/lib/jvm/java-8-oracle/jdk1.8.0_66
    
    sudo apt-get install -f
    sudo apt-get purge oracle-java8-installer
    sudo apt-get install oracle-java8-installer
    

    After that

    sudo apt-get install oracle-java8-set-default
    

    Either you use the PPA or the installation with an archive. But not both.

  • Related Question