I'm tring to install jdk 8 for weeks, but it fails.Following are some outputs,

sudo update-alternatives --config java

There is only one alternative in link group java (providing /usr/bin/java): /opt/java-oracle/jdk1.8.0/bin/java
Nothing to configure.

which java



 bash: /usr/local/java/jdk1.7.0_51/bin/java: No such file or directory

ls -l /usr/bin/java

 /usr/bin/java -> /etc/alternatives/java

ls -l /etc/alternatives/java

/etc/alternatives/java -> /opt/java-oracle/jdk1.8.0/bin/java

sudo update-alternatives --config javac

/opt/java-oracle/jdk1.8.0/bin/javac 1 manual mode


  Error: could not find libjava.so
  Error: Could not find Java SE Runtime Environment.

If you can please give me a help to slove this problem. Thank You


2 Answers 2


I installed the jdk just fine. Here's what I did.

  1. Get the .rpm file from Oracle's website.

  2. Open up a terminal and type this command:sudo apt-get install alien

  3. Wait for alien to install.

  4. Type: sudo alien -i -c <path to the file>

  5. Wait for that to finish installing. It will look like it's not doing anything for a while, but it is.

  6. Test the installation with: java -version

  7. You're done!

  • couldn't install : Errors were encountered while processing: jdk1.8.0-66 Unable to install at /usr/share/perl5/Alien/Package/Deb.pm line 92, <GETPERMS> line 1841. find jdk1.8.0_66-1.8.0_66 -type d -exec chmod 755 {} ; rm -rf jdk1.8.0_66-1.8.0_66 jprogrammer@ubuntu:~$
    – EKanadily
    Dec 10, 2015 at 18:58

I followed the suggested steps today, but was upset by the result. Mostly because installed Java was not registered in java-alternatives among other versions, and also because of apt complaining about "1 not fully installed or removed."

So I decided to provide an alternative answer.

The following steps made me happy today:

  1. Get the .tar.gz file from Oracle's website
  2. Use the following command to install the package converter specific to Java: sudo apt install java-package
  3. In the directory containing previously downloaded file, run the command: make-jpkg jdk-8u221-linux-x64.tar.gz (adjust the version if needed).
  4. Then run: sudo dpkg -i oracle-java8-jdk_8u221_amd64.deb (adjust the version if needed).
  5. If you have any other versions of Java installed, you may need to update alternatives: sudo update-java-alternatives --set oracle-java8-jdk-amd64
  6. Check everything is OK: java -version.

Now you can delete both .tar.gz and .deb files.

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.