Where is the classpath set for hadoop

Bourne picture Bourne · Feb 1, 2015 · Viewed 39k times · Source

Where is the classpath for hadoop set? When I run the below command it gives me the classpath. Where is the classpath set?

  bin/hadoop classpath

I'm using hadoop 2.6.0

Answer

Siva Krishnan picture Siva Krishnan · Dec 28, 2017

Open your bash profile (~/.profile or ~/.bash_profile) for editing and add the following:

  1. export HADOOP_HOME="/usr/local/Cellar/hadoop" then Replace with your own path
  2. export HADOOP_CLASSPATH=$(find $HADOOP_HOME -name '*.jar' | xargs echo | tr ' ' ':') Save the changes and reload.

  3. source ~/.profile