Set Environment Variables for the Current User
Procedure
-
Set
JAVA_HOME
the path of the Java directory.- Ubuntu
example:
$ export JAVA_HOME=/usr/lib/jvm/<version>
- RedHat/CentOS
example:
$ export JAVA_HOME=/usr/java/<version>
- Ubuntu
example:
-
Set HADOOP_CONF_DIR to the
path of the directory containing the Hadoop configuration parameters.- MapReduce V1
example:
$ export HADOOP_CONF_DIR=/opt/mapr/hadoop/hadoop-<version>/conf
- YARN
example:
$ export HADOOP_CONF_DIR=/opt/mapr/hadoop/hadoop-<version>/etc/hadoop/
- MapReduce V1
example:
Results
NOTE: A user who doesn't have
root
or sudo
permissions can
add these environment variable entries to the ~/.bashrc
file so that the
environment variables will be set each time the user logs in.