centos7 安装scala 2.10.6

时间:2022-06-27 06:59:09
[wangshumin@CentOSNode1 ~]$ ll
总用量 592728
drwxrwxr-x.  8 wangshumin wangshumin      4096 1月  29 01:08 ekl
drwxrwxr-x.  3 wangshumin wangshumin        18 3月  11 15:03 hadoop
drwxrwxr-x. 10 wangshumin wangshumin       161 3月  11 14:48 hadoop-2.6.5
-rw-rw-r--.  1 wangshumin wangshumin 199635269 6月  20 2017 hadoop-2.6.5.tar.gz
drwxrwxr-x.  2 wangshumin wangshumin        55 3月  11 12:42 hadoop-2.6.5.单机版伪分布式.tar.gzq
drwxrwxr-x.  3 wangshumin wangshumin        47 3月   3 17:14 mongodb
-rw-rw-r--.  1 wangshumin wangshumin  99309633 3月   3 17:13 mongodb-linux-x86_64-amazon-3.6.3.tgz
-rw-------.  1 wangshumin wangshumin         0 2月  26 18:50 nohup.out
drwxrwxr-x.  4 wangshumin wangshumin        33 3月   3 17:50 path
-rw-rw-r--.  1 wangshumin wangshumin  29928531 9月  18 2015 scala-2.10.6.tgz
drwxrwxr-x.  3 wangshumin wangshumin        39 3月  11 08:35 spark
-rw-r--r--.  1 wangshumin wangshumin 278057117 7月  18 2016 spark-1.6.2-bin-hadoop2.6.tgz
-rw-rw-r--.  1 wangshumin wangshumin        68 3月  11 12:39 tar压缩
-rw-rw-r--.  1 wangshumin wangshumin        65 1月  30 17:23 text.txt
drwxrwxr-x.  3 wangshumin wangshumin        21 3月  11 15:01 tmp
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 公共
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 模板
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 视频
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 图片
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 文档
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 下载
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 音乐
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 桌面
[wangshumin@CentOSNode1 ~]$ tar -xvf scala-2.10.6.tgz
scala-2.10.6/
scala-2.10.6/misc/
scala-2.10.6/misc/scala-devel/
scala-2.10.6/misc/scala-devel/plugins/
scala-2.10.6/misc/scala-devel/plugins/continuations.jar
scala-2.10.6/src/
scala-2.10.6/src/msil-src.jar
scala-2.10.6/src/fjbg-src.jar
scala-2.10.6/src/scala-partest-src.jar
scala-2.10.6/src/scala-swing-src.jar
scala-2.10.6/src/scalap-src.jar
scala-2.10.6/src/scala-library-src.jar
scala-2.10.6/src/scala-actors-src.jar
scala-2.10.6/src/scala-reflect-src.jar
scala-2.10.6/src/scala-compiler-src.jar
scala-2.10.6/man/
scala-2.10.6/man/man1/
scala-2.10.6/man/man1/scala.1
scala-2.10.6/man/man1/scalap.1
scala-2.10.6/man/man1/fsc.1
scala-2.10.6/man/man1/scaladoc.1
scala-2.10.6/man/man1/scalac.1
scala-2.10.6/bin/
scala-2.10.6/bin/scalac
scala-2.10.6/bin/fsc
scala-2.10.6/bin/fsc.bat
scala-2.10.6/bin/scala
scala-2.10.6/bin/scalap
scala-2.10.6/bin/scaladoc.bat
scala-2.10.6/bin/scaladoc
scala-2.10.6/bin/scalac.bat
scala-2.10.6/bin/scala.bat
scala-2.10.6/bin/scalap.bat
scala-2.10.6/examples/
scala-2.10.6/examples/iterators.scala
scala-2.10.6/examples/futures.scala
scala-2.10.6/examples/sort2.scala
scala-2.10.6/examples/actors/
scala-2.10.6/examples/actors/channels.scala
scala-2.10.6/examples/actors/links.scala
scala-2.10.6/examples/actors/pingpong.scala
scala-2.10.6/examples/actors/producers.scala
scala-2.10.6/examples/actors/fringe.scala
scala-2.10.6/examples/actors/boundedbuffer.scala
scala-2.10.6/examples/actors/seq.scala
scala-2.10.6/examples/actors/looping.scala
scala-2.10.6/examples/actors/message.scala
scala-2.10.6/examples/actors/auction.scala
scala-2.10.6/examples/patterns.scala
scala-2.10.6/examples/sort1.scala
scala-2.10.6/examples/fors.scala
scala-2.10.6/examples/oneplacebuffer.scala
scala-2.10.6/examples/tcpoly/
scala-2.10.6/examples/tcpoly/monads/
scala-2.10.6/examples/tcpoly/monads/Monads.scala
scala-2.10.6/examples/monads/
scala-2.10.6/examples/monads/directInterpreter.scala
scala-2.10.6/examples/monads/simpleInterpreter.scala
scala-2.10.6/examples/monads/stateInterpreter.scala
scala-2.10.6/examples/monads/callccInterpreter.scala
scala-2.10.6/examples/monads/errorInterpreter.scala
scala-2.10.6/examples/gadts.scala
scala-2.10.6/examples/boundedbuffer.scala
scala-2.10.6/examples/xml/
scala-2.10.6/examples/xml/phonebook/
scala-2.10.6/examples/xml/phonebook/phonebook.scala
scala-2.10.6/examples/xml/phonebook/phonebook1.scala
scala-2.10.6/examples/xml/phonebook/embeddedBook.scala
scala-2.10.6/examples/xml/phonebook/phonebook3.scala
scala-2.10.6/examples/xml/phonebook/verboseBook.scala
scala-2.10.6/examples/xml/phonebook/phonebook2.scala
scala-2.10.6/examples/package.scala
scala-2.10.6/examples/computeserver.scala
scala-2.10.6/examples/maps.scala
scala-2.10.6/examples/sort.scala
scala-2.10.6/examples/parsing/
scala-2.10.6/examples/parsing/ArithmeticParser.scala
scala-2.10.6/examples/parsing/JSON.scala
scala-2.10.6/examples/parsing/ArithmeticParsers.scala
scala-2.10.6/examples/parsing/MiniML.scala
scala-2.10.6/examples/parsing/lambda/
scala-2.10.6/examples/parsing/lambda/Main.scala
scala-2.10.6/examples/parsing/lambda/test/
scala-2.10.6/examples/parsing/lambda/test/test-04.kwi
scala-2.10.6/examples/parsing/lambda/test/test-05.kwi
scala-2.10.6/examples/parsing/lambda/test/test-01.kwi
scala-2.10.6/examples/parsing/lambda/test/test-02.kwi
scala-2.10.6/examples/parsing/lambda/test/test-07.kwi
scala-2.10.6/examples/parsing/lambda/test/test-06.kwi
scala-2.10.6/examples/parsing/lambda/test/test-08.kwi
scala-2.10.6/examples/parsing/lambda/test/test-03.kwi
scala-2.10.6/examples/parsing/lambda/TestSyntax.scala
scala-2.10.6/examples/parsing/lambda/TestParser.scala
scala-2.10.6/examples/parsing/ListParsers.scala
scala-2.10.6/examples/parsing/ListParser.scala
scala-2.10.6/doc/
scala-2.10.6/doc/tools/
scala-2.10.6/doc/tools/index.html
scala-2.10.6/doc/tools/scalap.html
scala-2.10.6/doc/tools/images/
scala-2.10.6/doc/tools/images/scala_logo.png
scala-2.10.6/doc/tools/images/external.gif
scala-2.10.6/doc/tools/scala.html
scala-2.10.6/doc/tools/css/
scala-2.10.6/doc/tools/css/style.css
scala-2.10.6/doc/tools/fsc.html
scala-2.10.6/doc/tools/scalac.html
scala-2.10.6/doc/tools/scaladoc.html
scala-2.10.6/doc/README
scala-2.10.6/doc/licenses/
scala-2.10.6/doc/licenses/mit_jquery-ui.txt
scala-2.10.6/doc/licenses/mit_sizzle.txt
scala-2.10.6/doc/licenses/apache_jansi.txt
scala-2.10.6/doc/licenses/bsd_asm.txt
scala-2.10.6/doc/licenses/mit_tools.tooltip.txt
scala-2.10.6/doc/licenses/mit_jquery-layout.txt
scala-2.10.6/doc/licenses/mit_jquery.txt
scala-2.10.6/doc/licenses/bsd_jline.txt
scala-2.10.6/doc/LICENSE
scala-2.10.6/lib/
scala-2.10.6/lib/scala-reflect.jar
scala-2.10.6/lib/scalap.jar
scala-2.10.6/lib/scala-swing.jar
scala-2.10.6/lib/scala-actors-migration.jar
scala-2.10.6/lib/typesafe-config.jar
scala-2.10.6/lib/scala-actors.jar
scala-2.10.6/lib/jline.jar
scala-2.10.6/lib/scala-library.jar
scala-2.10.6/lib/scala-compiler.jar
scala-2.10.6/lib/akka-actors.jar
[wangshumin@CentOSNode1 ~]$ ll
总用量 592728
drwxrwxr-x.  8 wangshumin wangshumin      4096 1月  29 01:08 ekl
drwxrwxr-x.  3 wangshumin wangshumin        18 3月  11 15:03 hadoop
drwxrwxr-x. 10 wangshumin wangshumin       161 3月  11 14:48 hadoop-2.6.5
-rw-rw-r--.  1 wangshumin wangshumin 199635269 6月  20 2017 hadoop-2.6.5.tar.gz
drwxrwxr-x.  2 wangshumin wangshumin        55 3月  11 12:42 hadoop-2.6.5.单机版伪分布式.tar.gzq
drwxrwxr-x.  3 wangshumin wangshumin        47 3月   3 17:14 mongodb
-rw-rw-r--.  1 wangshumin wangshumin  99309633 3月   3 17:13 mongodb-linux-x86_64-amazon-3.6.3.tgz
-rw-------.  1 wangshumin wangshumin         0 2月  26 18:50 nohup.out
drwxrwxr-x.  4 wangshumin wangshumin        33 3月   3 17:50 path
drwxrwxr-x.  9 wangshumin wangshumin        89 9月  18 2015 scala-2.10.6
-rw-rw-r--.  1 wangshumin wangshumin  29928531 9月  18 2015 scala-2.10.6.tgz
drwxrwxr-x.  3 wangshumin wangshumin        39 3月  11 08:35 spark
-rw-r--r--.  1 wangshumin wangshumin 278057117 7月  18 2016 spark-1.6.2-bin-hadoop2.6.tgz
-rw-rw-r--.  1 wangshumin wangshumin        68 3月  11 12:39 tar压缩
-rw-rw-r--.  1 wangshumin wangshumin        65 1月  30 17:23 text.txt
drwxrwxr-x.  3 wangshumin wangshumin        21 3月  11 15:01 tmp
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 公共
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 模板
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 视频
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 图片
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 文档
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 下载
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 音乐
drwxr-xr-x.  2 wangshumin wangshumin         6 1月  28 15:09 桌面
[wangshumin@CentOSNode1 ~]$ cd scala-2.10.6
[wangshumin@CentOSNode1 scala-2.10.6]$ ll
总用量 4
drwxrwxr-x. 2 wangshumin wangshumin  162 9月  18 2015 bin
drwxrwxr-x. 4 wangshumin wangshumin   64 9月  18 2015 doc
drwxrwxr-x. 7 wangshumin wangshumin 4096 9月  18 2015 examples
drwxrwxr-x. 2 wangshumin wangshumin  248 9月  18 2015 lib
drwxrwxr-x. 3 wangshumin wangshumin   18 9月  18 2015 man
drwxrwxr-x. 3 wangshumin wangshumin   25 9月  18 2015 misc
drwxrwxr-x. 2 wangshumin wangshumin  240 9月  18 2015 src
[wangshumin@CentOSNode1 scala-2.10.6]$ pwd
/home/wangshumin/scala-2.10.6
[wangshumin@CentOSNode1 scala-2.10.6]$ sudo vim  /etc/profile
[sudo] wangshumin 的密码:
[wangshumin@CentOSNode1 scala-2.10.6]$ . /etc/profile
[wangshumin@CentOSNode1 scala-2.10.6]$ cd bin/
[wangshumin@CentOSNode1 bin]$ ll
总用量 80
-rwxrwxr-x. 1 wangshumin wangshumin 5380 9月  18 2015 fsc
-rwxrwxr-x. 1 wangshumin wangshumin 4620 9月  18 2015 fsc.bat
-rwxrwxr-x. 1 wangshumin wangshumin 5384 9月  18 2015 scala
-rwxrwxr-x. 1 wangshumin wangshumin 4628 9月  18 2015 scala.bat
-rwxrwxr-x. 1 wangshumin wangshumin 5371 9月  18 2015 scalac
-rwxrwxr-x. 1 wangshumin wangshumin 4602 9月  18 2015 scalac.bat
-rwxrwxr-x. 1 wangshumin wangshumin 5375 9月  18 2015 scaladoc
-rwxrwxr-x. 1 wangshumin wangshumin 4610 9月  18 2015 scaladoc.bat
-rwxrwxr-x. 1 wangshumin wangshumin 5374 9月  18 2015 scalap
-rwxrwxr-x. 1 wangshumin wangshumin 4608 9月  18 2015 scalap.bat
[wangshumin@CentOSNode1 bin]$  scala
Welcome to Scala version 2.10.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_162).
Type in expressions to have them evaluated.
Type :help for more information.


scala> [wangshumin@CentOSNode1 bin]$ 
[wangshumin@CentOSNode1 bin]$ 
[wangshumin@CentOSNode1 bin]$ 
[wangshumin@CentOSNode1 bin]$  scala -versionn
bad option: '-versionn'


Usage: scala <options> [<script|class|object|jar> <arguments>]
   or  scala -help


All options to scalac (see scalac -help) are also allowed.


[wangshumin@CentOSNode1 bin]$  scala -version
Scala code runner version 2.10.6 -- Copyright 2002-2013, LAMP/EPFL
[wangshumin@CentOSNode1 bin]$ scala -help
Usage: scala <options> [<script|class|object|jar> <arguments>]
   or  scala -help


All options to scalac (see scalac -help) are also allowed.
The first given argument other than options to scala designates
what to run.  Runnable targets are:


  - a file containing scala source
  - the name of a compiled class
  - a runnable jar file with a valid Main-Class attribute
  - or if no argument is given, the repl (interactive shell) is started


Options to scala which reach the java runtime:


 -Dname=prop  passed directly to java to set system properties
 -J<arg>      -J is stripped and <arg> passed to java as-is
 -nobootcp    do not put the scala jars on the boot classpath (slower)


Other startup options:


 -howtorun    what to run <script|object|jar|guess> (default: guess)
 -i <file>    preload <file> before starting the repl
 -e <string>  execute <string> as if entered in the repl
 -save        save the compiled script in a jar for future use
 -nc          no compilation daemon: do not use the fsc offline compiler


A file argument will be run as a scala script unless it contains only
self-contained compilation units (classes and objects) and exactly one
runnable main method.  In that case the file will be compiled and the
main method invoked.  This provides a bridge between scripts and standard
scala source.




Options for plugin 'continuations':
  -P:continuations:enable        Enable continuations


[wangshumin@CentOSNode1 bin]$ cat /etc/profile
# /etc/profile


# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc


# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.


pathmunge () {
    case ":${PATH}:" in
        *:"$1":*)
            ;;
        *)
            if [ "$2" = "after" ] ; then
                PATH=$PATH:$1
            else
                PATH=$1:$PATH
            fi
    esac
}




if [ -x /usr/bin/id ]; then
    if [ -z "$EUID" ]; then
        # ksh workaround
        EUID=`/usr/bin/id -u`
        UID=`/usr/bin/id -ru`
    fi
    USER="`/usr/bin/id -un`"
    LOGNAME=$USER
    MAIL="/var/spool/mail/$USER"
fi


# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
fi


HOSTNAME=`/usr/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
    export HISTCONTROL=ignoreboth
else
    export HISTCONTROL=ignoredups
fi


export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL


# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
    umask 002
else
    umask 022
fi


for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then 
            . "$i"
        else
            . "$i" >/dev/null
        fi
    fi
done


unset i
unset -f pathmunge




export JAVA_HOME=/home/wangshumin/ekl/jdk1.8.0_162
export PATH=$PATH:$JAVA_HOME/bin


export ES_HOME=/home/wangshumin/ekl/elasticsearch-5.3.1
export PATH=$PATH:$ES_HOME/bin


export KIBANA_HOME=/home/wangshumin/ekl/kibana-5.3.1-linux-x86_64
export PATH=$PATH:$KIBANA_HOME/bin


export LOGSTASH_HOME=/home/wangshumin/ekl/logstash-5.3.1
export PATH=$PATH:$LOGSTASH_HOME/bin


export HADOOP_HOME=/home/wangshumin/hadoop-2.6.5
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin


export STORM_HOME=/home/wangshumin/storm/apache-storm-0.9.5
export PATH=$PATH:$STORM_HOME/bin


export SPARK=/home/wangshumin/spark/spark-1.6.2-bin-hadoop2.6
export PATH=$PATH:$SPARK/bin:$SPARK/sbin


export SCALA=/home/wangshumin/scala-2.10.6
export PATH=$PATH:$SCALA/bin




export PATH=$PATH:/home/wangshumin/ekl/node-v4.4.7-linux-x64/bin
[wangshumin@CentOSNode1 bin]$