- Download the compressed installation package
scala official website download address
Right click to copy the download address
# 下载压缩包到云服务器
wget https://downloads.lightbend.com/scala/2.13.4/scala-2.13.4.tgz
# 解压缩
tar -zxvf scala-2.13.4.tgz
2. Configure environment variables
cd scala-2.13.4/
# 获取当前路径地址
pwd
# 环境变量配置
vi ~/.bash_profile
# 按 i 进入编辑模式
# 添加进去scala启动路径
export SCALA_HOME=/root/software/scala-2.13.4
export PATH=$SCALA_HOME/bin:$PATH
# 按 esc 退出 编辑模式
# wq保存并退出
:wq
3. Make the configuration file effective
source ~/.bash_profile
echo $SCALA_HOME
# 测试
cd ~
scala
Successfully entered the scala editing environment