Ubuntu 16.04: Oracle JDK 9 not installed

Every time I try to install something from the terminal, this message appears to me. Meanwhile, I have my Java installed:

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

Please help me solve this problem; it is really annoying.

+7
java ubuntu
source share
6 answers
 sudo apt-get purge oracle-java9-installer 

solved my problem. Later, I also changed the Ubuntu Software Center Server to the Primary Server.

+4
source share

In fact, I ran into a problem after allowing the installation of wine in my Ubuntu 16.04 LTS . The fault problem that I solved using the link below.

https://askubuntu.com/questions/935050/unknown-error-class-keyerror-the-cache-has-no-package-named-wine1-6-i38

So, landed on this post. But I could not install java from apt packages. It threw me a mistake. Then I realized that there was a problem with multiple Java instances on my system. I already have Oracle Java 9 installed. I just needed to change the current versions using the command

 sudo update-alternatives --config java 

So, if any of the bodies gets into error, you can try to fix this.

+2
source share

I'm not sure what steps you tried to install already, but the link below is a pretty well-explained description of how to install the JDK on Ubuntu. I always installed JDK via webupd8team ppa, and it worked for me so far :)

A note about the link, it suggests setting the home variable, it may be necessary for you, but I never did it manually, and it worked, so give it a quick check before setting the home variable yourself.

https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04

0
source share

I solved the problem by uninstalling all versions of java and cleaning them up and installing them again, perhaps thanks to everyone who tried to help.

0
source share

Add Oracle PPA first, and then update the package repository.

 $sudo add-apt-repository ppa:webupd8team/java $sudo apt-get update 

To install JDK 9, use the following command:

 $sudo apt-get install oracle-java9-installer 
0
source share

To completely remove the Oracle JDK, run the following commands:

Delete criteria completely:

 sudo apt-get remove oracle-java9-installer sudo apt-get remove --auto-remove oracle-java9-installer sudo apt-get purge oracle-java9-installer sudo apt-get purge --auto-remove oracle-java9-installer 

Link to the resource:

https://www.howtoinstall.co/en/ubuntu/trusty/tomcat7?action=remove

After that install jdk using the following command:

Install JDK9 on Ubuntu:

 sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java9-installer 

Make it the default:

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

Link to the resource:

http://zakirrizvi.blogspot.com/2017/10/install-jdk9-in-ubuntu.html

-one
source share

All Articles