Skip to content

Could not find or load main class -Djava.library.path=.opt.hadoop.lib.native [SOLVED]

If you encounter this error in setting up your Hadoop cluster do the following:

Open a terminal
nano ~/.bashrc
Scroll to the bottom and add the following line
export HADOOP_OPTS=”$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/”
Save the file and close it
source ~/.bashrc

The changes will take effect after your system comes back online