ITPub博客

首页 > 大数据 > 数据分析 > SPARK 安装之scala 安装

SPARK 安装之scala 安装

原创 数据分析 作者:self_control 时间:2015-09-30 17:11:29 0 删除 编辑
1、文件下载
scala 下载 到http://www.scala-lang.org/download/ 这个地方下载(居然自动识别操作系统,我还要linux系统中点击下载)
下载后进行解压 
[root@h1 hadoop]# cd 下载
[root@h1 下载]# tar -zxvf scala-2.11.7.tgz
...
[root@h1 下载]# ls
scala-2.11.7  scala-2.11.7.tgz
把解压后的文件移到/usr/lib/scala 
[root@h1 下载]# mkdir /usr/lib/scala 
[root@h1 下载]# mv scala-2.11.7 /usr/lib/scala/
[root@h1 下载]# cd /usr/lib/scala/
[root@h1 scala]# ls
scala-2.11.7

2、SCALA配置
修改环境变量 加入SCALA_HOME  及 path
[hadoop@h1 ~]$ vi .bash_profile 
# .bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi


# User specific environment and startup programs
HADOOP_HOME=/home/hadoop/hadoop-1.1.2
SCALA_HOME=/usr/lib/scala/scala-2.11.7
JAVA_HOME=/home/hadoop/jdk1.6/jdk1.6.0_45 
PATH=$PATH:$HOME/bin:$HADOOP_HOME/bin:$JAVA_HOME/bin:$SCALA_HOME/bin
CLASSPATH=.:JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH
export JAVA_HOME
export CLASSPATH
export SCALA_HOME
~
~
~
~
~
~
".bash_profile" 17L, 451C 已写入                                                
使用环境变量生效
[hadoop@h1 ~]$ source .bash_profile
 
3、测试scala
[hadoop@h1 ~]$ scala
Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_45).
Type in expressions to have them evaluated.
Type :help for more information.


scala> 9+9
res0: Int = 18

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30066956/viewspace-1812556/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-12-16

  • 博文量
    49
  • 访问量
    406897