SPARK 安装之scala 安装

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博客 ” ,链接:http://blog.itpub.net/30066956/viewspace-1812556/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30066956/viewspace-1812556/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值