14

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

Zanna
  • 70,465
  • What is the output of 'update-alternatives --display java'? – willl459 Jun 09 '15 at 05: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 09 '15 at 05: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 09 '15 at 05: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 09 '15 at 06: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 '15 at 19:05
  • Chances are you downloaded a 32 bit installation package. I found out this very late after spending the whole afternoon – bademba Apr 17 '21 at 16:43

5 Answers5

32

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

Zanna
  • 70,465
Maythux
  • 84,289
  • i have executed the command you listed above but i am getting an error:-Package 'libc6-i386' has no installation candidate – Adla Sutej Jun 09 '15 at 05:29
  • 1
    run sudo apt-get update and then sudo apt-get install libc6-i386 – Maythux Jun 09 '15 at 05: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 09 '15 at 05:39
  • list down your error – Maythux Jun 09 '15 at 05:39
  • W: Failed to fetch http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/dists/trusty/main/i18n/Translation-en Unable to connect to 172.17.11.81:3142: E: Some index files failed to download. They have been ignored, or old ones used instead – Adla Sutej Jun 09 '15 at 05:41
  • remove this ppa from your source.list – Maythux Jun 09 '15 at 05:41
  • still getting error:- Err http://archive.ubuntu.com trusty-backports/universe Translation-en Unable to connect to 172.17.11.81:3142: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/universe/i18n/Translation-en Unable to connect to 172.17.11.81:3142: – Adla Sutej Jun 09 '15 at 05:47
  • Change the server from software source – Maythux Jun 09 '15 at 05:49
  • 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 09 '15 at 05:55
  • Open Software center then go to edit softwares sources and there you can change the srever – Maythux Jun 09 '15 at 05:58
  • when i edited the server then i got an error :- "Failed to download repository information, Check your Internet connection." i am using my college wifi. is there any problem with my wifi – Adla Sutej Jun 09 '15 at 06:07
  • 1
    saved my life. and 20 minutes of frustration. – Mirror Mirage Feb 08 '20 at 05:55
5

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.

Zanna
  • 70,465
LesPaul
  • 51
0

Try installing OpenJDK 8:

sudo apt install openjdk-8-jre

It worked for me

shivampip
  • 471
0

idk but this worked for me on my parrot os

cd /usr/lib/jvm
ls

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
0

hosted on GoDaddy and using the putty to run the liquibase DB management.

Some how it's not working and it's give me error as No Such File Found.

Below link having the solution for this problem.

JAVA_HOME=<Directory where JAVA has been extracted>/jdk1.8.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH

https://www.guru99.com/how-to-install-java-on-ubuntu.html

Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26
Somnath
  • 101
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Esther Sep 06 '22 at 15:14