在MacOS上成功编译Spark

我使用的是最新的MacOS版本:

在MacOS上成功编译Spark_第1张图片

打开终端窗口,我使用的是iTerm。然后有两个重要的环境变量需要设置:

1. JAVA_HOME

~ export JAVA_HOME=$(/usr/libexec/java_home)
~ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

2. TERM

~ export TERM=xterm-color

这样就可以开始编译spark项目了。先从github下载spark:

~ git clone https://github.com/apache/spark.git

进入目录spark,开始编译:

~ cd spark

~ build/mvn -DskipTests clean package

等待比较长的时间,到最后得到了成功编译的信息,cool:

......
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Spark Project Parent POM 3.0.0-SNAPSHOT:
[INFO]
[INFO] Spark Project Parent POM ........................... SUCCESS [  4.461 s]
[INFO] Spark Project Tags ................................. SUCCESS [  7.807 s]
[INFO] Spark Project Sketch ............................... SUCCESS [  5.226 s]
[INFO] Spark Project Local DB ............................. SUCCESS [  3.190 s]
[INFO] Spark Project Networking ........................... SUCCESS [  7.237 s]
[INFO] Spark Project Shuffle Streaming Service ............ SUCCESS [  4.041 s]
[INFO] Spark Project Unsafe ............................... SUCCESS [  6.865 s]
[INFO] Spark Project Launcher ............................. SUCCESS [  4.442 s]
[INFO] Spark Project Core ................................. SUCCESS [01:44 min]
[INFO] Spark Project ML Local Library ..................... SUCCESS [07:06 min]
[INFO] Spark Project GraphX ............................... SUCCESS [  7.309 s]
[INFO] Spark Project Streaming ............................ SUCCESS [ 17.513 s]
[INFO] Spark Project Catalyst ............................. SUCCESS [02:34 min]
[INFO] Spark Project SQL .................................. SUCCESS [06:49 min]
[INFO] Spark Project ML Library ........................... SUCCESS [01:52 min]
[INFO] Spark Project Tools ................................ SUCCESS [  7.046 s]
[INFO] Spark Project Hive ................................. SUCCESS [ 49.826 s]
[INFO] Spark Project Graph API ............................ SUCCESS [  1.405 s]
[INFO] Spark Project Cypher ............................... SUCCESS [04:07 min]
[INFO] Spark Project Graph ................................ SUCCESS [  1.952 s]
[INFO] Spark Project REPL ................................. SUCCESS [  3.023 s]
[INFO] Spark Project Assembly ............................. SUCCESS [  3.674 s]
[INFO] Kafka 0.10+ Token Provider for Streaming ........... SUCCESS [01:59 min]
[INFO] Spark Integration for Kafka 0.10 ................... SUCCESS [ 23.340 s]
[INFO] Kafka 0.10+ Source for Structured Streaming ........ SUCCESS [  7.574 s]
[INFO] Spark Project Examples ............................. SUCCESS [ 15.558 s]
[INFO] Spark Integration for Kafka 0.10 Assembly .......... SUCCESS [  3.715 s]
[INFO] Spark Avro ......................................... SUCCESS [  5.527 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  29:26 min
[INFO] Finished at: 2019-07-18T08:37:33+08:00
[INFO] ------------------------------------------------------------------------

 

你可能感兴趣的:(Spark)