I have installed jdk1.8.0 manually from the oracle website.

I have followed the steps here on Digital Ocean.

When I executed java -version I got this result:-

bash: /usr/bin/java: No such file or directory

A symbolic link java is present in /usr/bin/ which is linked to another symbolic link java present in /etc/alternatives/and this link points to /usr/lib/jvm/jdk1.8.0.

I have set environment variables:- PATH,JAVA_HOME in the files ~/.bashrc and /etc/profile. Still I am getting No such file or directory.

Actually I want to install hadoop and for this the first step is to install java. I am using Ubuntu 14.04

  • What is the output of 'update-alternatives --display java'?
    – willl459
    Jun 9, 2015 at 5:25
  • output:- java - auto mode link currently points to /usr/lib/jvm/jdk1.8.0_45/bin/java /usr/lib/jvm/jdk1.8.0_45/bin/java - priority 3 /usr/lib/jvm/jre1.8.0_45/bin/java - priority 2 Current 'best' version is '/usr/lib/jvm/jdk1.8.0_45/bin/java'.
    – Adla Sutej
    Jun 9, 2015 at 5:35
  • The instructions on that site suggest extracting the Java package into /opt/jdk and then creating a symbolic link from /usr/bin to it. Your output suggests you instead symbolic linked to /usr/lib/jvm/jdk1.8.0_45 but no information on linked from where. Double check that the link and path provided to the update-alternatives command are /usr/bin/java and the extract location, respectively. The man page for update-alternatives is here.
    – willl459
    Jun 9, 2015 at 5:53
  • i have now extracted file into /opt/jdk and now the output of update-alternatives --display java command is :- java - auto mode link currently points to /opt/jdk/jdk1.8.0_45/bin/java /opt/jdk/jdk1.8.0_45/bin/java - priority 100 . still i am getting same error message on executing java- version /usr/lib/jvm/jre1.8.0_45/bin/java - priority 2 Current 'best' version is '/opt/jdk/jdk1.8.0_45/bin/java'
    – Adla Sutej
    Jun 9, 2015 at 6:26
  • You will have to follow the guidance of Maythux below, it seems everything is extracted and linked properly so likely a missing dependency.
    – willl459
    Jun 10, 2015 at 19:05

4 Answers 4


This is because there are some 32-bit libraries missing in your Ubuntu 64-bit. Run:

apt-get install libc6-i386

you can refer to this Stack Overflow post for more information

  • i have executed the command you listed above but i am getting an error:-Package 'libc6-i386' has no installation candidate
    – Adla Sutej
    Jun 9, 2015 at 5:29
  • 1
    run sudo apt-get update and then sudo apt-get install libc6-i386
    – Maythux
    Jun 9, 2015 at 5:33
  • i have already executed the command sudo apt-get update command earlier and i am getting an error message Failed to fetch and it is not getting update. i have also googled this error and tried many solution but the problem has not been solved yet.
    – Adla Sutej
    Jun 9, 2015 at 5:39
  • 1
    actually i am new to ubuntu. i dont konw how to change the server from software source . will you please guide me sir!
    – Adla Sutej
    Jun 9, 2015 at 5:55
  • 1
    saved my life. and 20 minutes of frustration. Feb 8, 2020 at 5:55

I ran into a similar issue and got it solved by

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6-i386

If apt-get was not able to locate the libc-i386 package you may need to --add-architecture and run apt-get update.


Try installing OpenJDK 8:

sudo apt install openjdk-8-jre

It worked for me

  • but why? any details why adding another jdk solves this? Jan 7, 2020 at 12:20

idk but this worked for me on my parrot os

cd /usr/lib/jvm

Alternatively you can search for the path using

locate java-8-openjdk-amd64

Note - in my case it's openjdk8 find your java version with

java -version

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.