NickName:Bourne Ask DateTime:2015-02-01T15:53:33 Where is the classpath set for hadoop 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 Copyright Notice:Content Author:「Bourne」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/28260653/where-is-the-classpath-set-for-hadoop Answers Siva Krishnan 2017-12-28T10:17:35 Open your bash profile (~/.profile or ~/.bash_profile) for editing and add the following:\n\n\nexport HADOOP_HOME=\"/usr/local/Cellar/hadoop\" then Replace with your own path\nexport HADOOP_CLASSPATH=$(find $HADOOP_HOME -name '*.jar' | xargs echo | tr ' ' ':')\nSave the changes and reload.\nsource ~/.profile\n", Ashrith 2015-02-01T08:28:52 As said by almas shaikh it's set in hadoop-config.sh, but you could add more jars to it in hadoop-env.sh\n\nHere is a relevant code from hadoop-env.sh which adds additional jars like capacity-scheduler and aws jar's.\n\nexport HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-\"/etc/hadoop\"}\n\n# Extra Java CLASSPATH elements. Automatically insert capacity-scheduler.\nfor f in $HADOOP_HOME/contrib/capacity-scheduler/*.jar; do\n if [ \"$HADOOP_CLASSPATH\" ]; then\n export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f\n else\n export HADOOP_CLASSPATH=$f\n fi\ndone\n\n# ... some other lines omitted\n\n# Add Aws jar\nexport HADOOP_CLASSPATH=$HADOOP_CLASSPATH:share/hadoop/tools/lib/*\n", SMA 2015-02-01T08:29:27 When you run hadoop command, it sources a file hadoop-config.sh that resides in $HADOOP_HDFS_HOME/libexec which sets your classpath (CLASSPATH) by picking jars residing in various directories viz. \n\n$HADOOP_HDFS_HOME/share/hadoop/mapreduce \n$HADOOP_HDFS_HOME/share/hadoop/common\n$HADOOP_HDFS_HOME/share/hadoop/hdfs etc.\n", Ming 2015-02-01T08:29:24 As per this blog post, it is in an environment variable named HADOOP_CLASSPATH. You can set it as you would any other environment variable, the specifics of which depend on which shell you use. If you use bash, then you can call like export HADOOP_CLASSPATH=/path/to/wherever:/path/to/wherever/else.",