I’m running Ubuntu 18.04 and cannot remove or reinstall the Java 11 SDK. I originally installed the OpenJDK version and things seemed to be fine but I wanted to install rsyslog today and couldn’t because of some Java 11SDK error.
I have tried running sudo apt remove openjdk-11-jdk and sudo apt purge openjdk-11-jdk
Here is the output from the purge command:
$ sudo apt purge openjdk-11-jdk Reading package lists... Done Building dependency tree Reading state information... Done Package 'openjdk-11-jdk' is not installed, so not removed The following packages were automatically installed and are no longer required: libice-dev libpthread-stubs0-dev libsm-dev libx11-dev libx11-doc libxau-dev libxcb1-dev libxdmcp-dev libxt-dev linux-image-4.15.0-122-generic linux-modules-4.15.0-122-generic x11proto-core-dev x11proto-dev xorg-sgml-doctools xtrans-dev Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up oracle-java11-installer-local (11.0.9-1~linuxuprising0) ... Before installing this package, please download the Oracle JDK 11 .tar.gz file with the same version as this package (version 11.0.4), and place it in /var/cache/oracle-jdk11-installer-local, E.g.: sudo mkdir -p /var/cache/oracle-jdk11-installer-local sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/ sha256sum mismatch jdk-11.0.9_linux-x64_bin.tar.gz Oracle JDK 11 is NOT installed. dpkg: error processing package oracle-java11-installer-local (--configure): installed oracle-java11-installer-local package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: oracle-java11-installer-local E: Sub-process /usr/bin/dpkg returned an error code (1)
It says it’s not installed but you can see it is with this command:
$ java –version
openjdk 18.104.22.168 2020-11-04
OpenJDK Runtime Environment (build 22.214.171.124+1-Ubuntu-0ubuntu1.18.04)
OpenJDK 64-Bit Server VM (build 126.96.36.199+1-Ubuntu-0ubuntu1.18.04, mixed mode, sharing)
I also download the jdk-11.0.4_linux-x64_bin.tar.gz and put it into the /var/cache/oracle-jdk11-installer-local as suggested in the output but it makes no difference.
Appreciate any thoughts or suggestions. I just want to get JDK 11 working properly at this point!