0

on typing java -version it is giving below error bash: /usr/bin/java: cannot execute binary file: Exec format error

I dont know what to do I want to install hadoop but I am unable to complete java installation

2 Answers2

0

That error generally means that the java package you have is not right type for your system. Typically this happens when a system of x86 tries to read x64-based files.

Faron
  • 1,398
  • 10
  • 14
  • It could be vice versa. He should see whether the file(JAR or class) is not corrupt also in some other system where Java is up and running. – Ashu Mar 01 '16 at 15:47
0

Seems some issue with your OpenJDK(default jdk) that comes with ubuntu. I have hadoop 2 installed - single node cluster on my ubuntu box. You can follow these steps to install Oracle Java 8 which is compatible with Hadoop2(MRv2). Open terminal(Ctrl+Alt+T)

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

then verify

java -version

and then setup env variables

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

And if you want you can refer to my blog about setting up Hadoop(MRv1 or MRv2) which contains pointers to some good blogs also.

Ashu
  • 3,966