Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Error: Could not find or load main class ”-Djava.library.path=.usr.local.hadoop.lib” while installing hadoop

Tags:

ubuntu

hadoop

I am trying to install Hadoop 2.9.2 on Ubuntu.

I have set same path to JAVA_HOME in ~/.bashrc and env.sh files.Two separate directories for data node and name node are created under hadoop_store with the right path.The java version is "java-11-openjdk-amd64". I am still facing an error while formating the namenode in the hadoop file system. Please help me in resolving it.

The link to the page whose instrutions I have been following. https://www.digitalvidya.com/blog/install-hadoop-on-ubuntu-and-run-your-first-mapreduce-program/

This is the error:

hduser@ubuntu:~$ hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

Error: Could not find or load main class ”-Djava.library.path=.usr.local.hadoop.lib”
Caused by: java.lang.ClassNotFoundException: ”-Djava.library.path=.usr.local.hadoop.lib”

like image 572
COCO.J Avatar asked May 13 '19 21:05

COCO.J


1 Answers

check your ~/.bashrc

if you add line

export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"

make sure the "" is correct

like image 125
ZiShi Avatar answered Sep 19 '22 07:09

ZiShi