forked from mahmoudparsian/data-algorithms-book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetenv.sh
executable file
·76 lines (68 loc) · 1.92 KB
/
setenv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#---------------------------------------------------
# This is an example to set environment variables
# for compiling/running MapReduce and Spark programs
#---------------------------------------------------
#
# IMPORTANT NOTE: You should update your script
# accordingly, where ever you see "mparsian",
# please change it to your installed directories.
#---------------------------------------------------
#-----------------
# set Java as jdk8
#-----------------
# macbook:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home
# linux:
# export JAVA_HOME=/usr/java/jdk8
echo "JAVA_HOME=$JAVA_HOME"
#
#--------
# set ant
#--------
export ANT_HOME=/Users/mparsian/zmp/zs/apache-ant-1.9.4
echo "ANT_HOME=$ANT_HOME"
#
export SCALA_HOME=/Users/mparsian/scala-2.11.8
echo "SCALA_HOME=$SCALA_HOME"
#---------------------------------------
# set your spark and hadoop environments
#---------------------------------------
export SPARK_HOME=/Users/mparsian/spark-2.1.0-bin-hadoop2.6
export HADOOP_HOME=/Users/mparsian/zmp/zs/hadoop-2.6.3
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
#---------
# set PATH
#---------
export PATH=$SCALA_HOME/bin:$JAVA_HOME/bin:$ANT_HOME/bin:$HADOOP_HOME/bin:$PATH
echo "PATH=$PATH"
#
BOOK_HOME=/Users/mparsian/zmp/github/data-algorithms-book
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
CLASSPATH=$CLASSPATH:$HADOOP_CONF_DIR
#
jars=`find $BOOK_HOME/lib -name '*.jar'`
for j in $jars ; do
CLASSPATH=$CLASSPATH:$j
done
#
#
jars=`find $HADOOP_HOME/ -name '*.jar'`
for j in $jars ; do
CLASSPATH=$j:$CLASSPATH
done
#
#
jars=`find $SCALA_HOME/lib -name '*.jar'`
for j in $jars ; do
CLASSPATH=$j:$CLASSPATH
done
#
CLASSPATH=$BOOK_HOME/dist/data_algorithms_book.jar:$CLASSPATH
CLASSPATH=$HADOOP_CONF_DIR:$CLASSPATH
#
#-------------------
# finalize CLASSPATH
#-------------------
export CLASSPATH=$CLASSPATH
export HADOOP_CLASSPATH=$CLASSPATH