ubuntu installation configuration sbt

Environmental Science:

  • ubuntu 16.04 lts
  • sbt 0.13.15

sbt-0.13.X Download

Official website address: http://www.scala-sbt.org/download.html 
Baidu online: link: https://pan.baidu.com/s/1o886Uls Password: kqh7

Extract the compressed package to the directory / usr/local /

tar -zxvf sbt-0.13.15.tgz -C /usr/local/sbt

Create sbt file in / usr/local/sbt /

cd /usr/local/sbt  
vim sbt

Copy the following to the sbt file
 

 #!/bin/bash
 BT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
 java $SBT_OPTS -jar /usr/local/sbt/bin/sbt-launch.jar "$@"

Note that the sbt-launch.jar directory is correct

Permission to modify sbt file

  chmod u+x sbt

Configure sbt environment variables

 vim /etc/profile

Add the following:
 

 export PATH=/usr/local/sbt/bin:$PATH

Then run:
 

 source /etc/profile

Make the document effective

Modify the sbtconfig.txt file under the sbt path

  vim /usr/local/sbt/conf/sbtconfig.txt

Add the following:

  -Dsbt.global.base=/home/rose/.sbt
  -Dsbt.boot.directory=/home/rose/.sbt/boot/
  -Dsbt.ivy.home=/home/rose/.ivy2

Pay attention to whether the path is correct

Check if sbt is installed successfully

  sbt sbt-version

Console output below

[root@host sbt]# sbt sbt-version   Java HotSpot(TM) 64-Bit Server VM
warning: ignoring option MaxPermSize=1024M; support was removed in 8.0
WARN: No sbt.version set in project/build.properties, base
directory: /root/scala/sbt   
[warn] Executing in batch mode.   
[warn]For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitlypassing 'shell'   
[info] Set current project to sbt (in build file:/root/scala/sbt/)   
[info] 0.13.15

Installation successful

Configuring Alibaba cloud's maven warehouse

Create the repositories file under ~ /. sbt /

cd ~/.sbt   
vim repositories

Add the following
  

[repositories]   
local   
osc: http://maven.aliyun.com/nexus/content/groups/public   
typesafe:http://repo.typesafe.com/typesafe/ivy-releases/,[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/artifact.[ext],bootOnly   
sonatype-oss-releases   
maven-central
sonatype-oss-snapshots

Tags: vim Scala Maven Java

Posted on Sat, 02 May 2020 23:34:07 -0700 by jmurch