李林超博客
首页
归档
留言
友链
动态
关于
归档
留言
友链
动态
关于
首页
大数据
正文
CentOS7.X安装Scala2.12.10教程
Leefs
2021-08-16 AM
1675℃
0条
# CentOS7.X安装Scala2.12.10教程 ### 前言 如果需要研究Spark或者Kafka都需要安装Scala环境。 本次安装的Scala版本是2.12.10。 ### 一、安装步骤 #### 1.1 下载软件 ``` [root@hadoopserver sources]# wget https://downloads.lightbend.com/scala/2.12.10/scala-2.12.10.tgz ``` #### 1.2 拷贝并解压 ``` # 将scala安装包拷贝到/usr/local目录下 [root@hadoopserver sources]# cp scala-2.12.10.tgz /usr/local/ # 解压安装包 [root@hadoopserver local]# tar -zxvf scala-2.12.10.tgz ``` #### 1.3 添加环境变量 ``` # scala export SCALA_HOME=/usr/local/scala-2.12.10 export PATH=$PATH:$SCALA_HOME/bin ``` #### 1.4 重新载入资源 ``` [root@hadoopserver local]# source /etc/profile ``` #### 1.5 测试 ``` [root@hadoopserver local]# scala -version Scala code runner version 2.12.10 -- Copyright 2002-2019, LAMP/EPFL and Lightbend, Inc. ``` ### 二、Scala简单命令 #### 2.1 进入Scala ``` [root@hadoopserver local]# scala Welcome to Scala 2.12.10 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_241). Type in expressions for evaluation. Or try :help. scala> ``` #### 2.2 查看帮助文档 ``` scala> :help All commands can be abbreviated, e.g., :he instead of :help. :completions
output completions for the given string :edit
|
edit history :help [command] print this summary or command-specific help :history [num] show the history (optional num is commands to show) :h?
search the history :imports [name name ...] show import history, identifying sources of names :implicits [-v] show the implicits in scope :javap
disassemble a file or class name :line
|
place line(s) at the end of history :load
interpret lines in a file :paste [-raw] [path] enter paste mode or paste a file :power enable power user mode :quit exit the interpreter :replay [options] reset the repl and replay all previous commands :require
add a jar to the classpath :reset [options] reset the repl to its initial state, forgetting all session entries :save
save replayable session to a file :sh
run a shell command (result is implicitly => List[String]) :settings
update compiler options, if possible; see reset :silent disable/enable automatic printing of results :type [-v]
display the type of an expression without evaluating it :kind [-v]
display the kind of a type. see also :help kind :warnings show the suppressed warnings from the most recent line which had any ``` #### 2.3 退出 ``` scala> :quit ``` #### 2.4 编译 ``` # xxx为Scala文件名称 [root@hadoopserver sources]# scalac xxx.scala ``` #### 2.5 运行 ``` # xxx为Scala文件名称 [root@hadoopserver sources]# scala xxx ```
标签:
Scala
非特殊说明,本博所有文章均为博主原创。
如若转载,请注明出处:
https://lilinchao.com/archives/1388.html
上一篇
02.Kafka常用命令
下一篇
【转载】Spring Boot在启动时进行配置文件加解密
评论已关闭
栏目分类
随笔
2
Java
326
大数据
229
工具
31
其它
25
GO
47
NLP
4
标签云
Typora
GET和POST
前端
Git
JavaWEB项目搭建
Sentinel
JVM
Hbase
Netty
HDFS
数据结构和算法
算法
Hadoop
随笔
Golang基础
Quartz
Spark Streaming
Elasticsearch
Kafka
ajax
Flink
字符串
Spark
机器学习
Docker
高并发
ClickHouse
Zookeeper
锁
稀疏数组
友情链接
申请
范明明
庄严博客
Mx
陶小桃Blog
虫洞
评论已关闭