0

Please help! I have downloaded the .deb version of Java SE JDK from this site: https://www.oracle.com/java/technologies/javase-jdk11-downloads.html This .deb file is saved in my Downloads folder. When I double click the icon the Ubuntu Software Install page pops up, I hit install, but it never installs.

enter image description here

It shows up under the installed tab, but then it still says install on the far right column. enter image description here

So I press Install again, and it says are you sure you want to remove it? If I click remove, it just disappears from Ubuntu Software. I have tried sudo dpkg -i jdk-11.07_linux-x64_bin.deb but I get "dpkg: error: cannot access archive 'jdk-11.07_linux-x64_bin.deb': No such file or directory".

When trying to install using Terminal, I receive this error: 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)

Any ideas? enter image description here

Nothing is in the java-11-oracle directory. I have downloaded jdk-11.0.7_linux-x64_bin.tar.gz and placed it into /var/cache/oracle-jdk11-installer-local, but now when I run sudo add-apt-repository ppa:linuxuprising/java I get an error Err:1 archive.ubuntu eoan InRelease Could not resolve 'archive.ubuntu' enter image description here

2
  • should you do it in software center? Don't you want to install it on terminal? Apr 26, 2020 at 3:20
  • Did you cd to the directory where the .deb file is saved? Apr 26, 2020 at 3:35

1 Answer 1

2

You can follow these steps to install it:

sudo add-apt-repository ppa:linuxuprising/java

sudo apt-get update

sudo apt-get install openjdk-11-jdk

And then you can choose which java version to use as default

sudo update-alternatives --config java
8
  • why do I get this when I run the last line, to set java 11 as default? Reading package lists... Done Building dependency tree Reading state information... Done Package oracle-java11-set-default-local 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-java11-set-default-local' has no installation candidate
    – rbj
    Apr 26, 2020 at 17:12
  • I have editted my answer for you to choose which java version you want as default. Apr 27, 2020 at 1:06
  • I only have one alternative? Please see new screenshot as there are multiple java versions in /usr/lib/jvm directory. sudo update-alternatives --config java gives me There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java
    – rbj
    Apr 27, 2020 at 1:22
  • yes you have only one alternative, because you installed only one version of java. If you have had more than one already you could choose of course. I mean it give you chance to choose java version from your installed. For example if you install java 12, you will have 2 options to choose. Apr 27, 2020 at 1:51
  • And I think my answer deserved of being "accepted answer" :) Apr 27, 2020 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.