下载地址:http://www.scala-sbt.org/download.html

当前版本:sbt-0.13.13.tgz

安装

1.解压并赋予权限

[root@hidden util]# tar -zxvf sbt-0.13.13.tgz
sbt-launcher-packaging-0.13.13/
sbt-launcher-packaging-0.13.13/conf/
sbt-launcher-packaging-0.13.13/conf/sbtconfig.txt
sbt-launcher-packaging-0.13.13/conf/sbtopts
sbt-launcher-packaging-0.13.13/bin/
sbt-launcher-packaging-0.13.13/bin/sbt.bat
sbt-launcher-packaging-0.13.13/bin/sbt
sbt-launcher-packaging-0.13.13/bin/sbt-launch.jar
sbt-launcher-packaging-0.13.13/bin/sbt-launch-lib.bash
[root@hidden util]# mv sbt-launcher-packaging-0.13.13 sbt
[root@hidden util]# chown -R root sbt
[root@hidden util]# chgrp -R root sbt
[root@hidden util]# cd sbt
[root@hidden sbt]# ls
bin  conf

2.建立启动脚本

在当前目录下(sbt/)创建文件sbt:vim sbt

编辑如下内容:(当前sbt的目录为:/root/util/sbt/)

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

添加权限

[root@hidden sbt]# chmod a+x sbt

3.配置PATH环境变量

之后在/etc/profile文件中添加(vim /etc/profile)

export PATH=$PATH:/root/util/sbt/

之后将文件立即生效:

[root@hidden sbt]# source /etc/profile
  1. 验证成功

    最后测试是否验证成功:
[root@hidden sbt]# sbt sbt-version
[info] Set current project to sbt (in build file:/root/util/sbt/)
[info] 0.13.13

异常

在实际安装过程中遇到如下的问题,在刚开始运行sbt sbt-version时出现“Error: Could not retrieve sbt 0.13.13”:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Getting org.scala-sbt sbt 0.13.13 ...
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
You probably access the destination server through a proxy server that is not well configured.
(省略若干....)
:: problems summary ::
:::: WARNINGS
    Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.6/scala-library-2.10.6.pom
    Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.6/scala-library-2.10.6.jar
(省略若干....)
unresolved dependency: org.scala-sbt#launcher-interface;1.0.0-M1: not found
unresolved dependency: org.scala-sbt#compiler-interface;0.13.13: not found
download failed: org.scala-sbt#sbt;0.13.13!sbt.jar
download failed: org.scala-sbt#main;0.13.13!main.jar
download failed: org.scala-sbt#actions;0.13.13!actions.jar
download failed: org.scala-sbt#task-system;0.13.13!task-system.jar
Error during sbt execution: Error retrieving required libraries
  (see /root/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.13

这时候需要添加一点东西,首先在conf/sbtconfig.txt中添加:

[root@hidden sbt]# vim conf/sbtconfig.txt

在此文件中添加:

-Dsbt.boot.directory=/root/util/sbt/.sbt/boot
-Dsbt.global.base=/root/util/sbt/.sbt
-Dsbt.ivy.home=/root/util/sbt/.ivy2
-Dsbt.repository.config=/root/util/sbt/conf/repo.properties
-Dsbt.repository.secure=false

其次在conf/目录下添加repo.properties中添加一些内容

[root@hidden sbt]# vim conf/repo.properties

repo.properties中添加:

[repositories]
  local
  Nexus osc : https://code.lds.org/nexus/content/groups/main-repo
  Nexus osc thirdparty : https://code.lds.org/nexus/content/groups/plugin-repo/
  typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
  typesafe2: http://repo.typesafe.com/typesafe/releases/
  sbt-plugin: http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/
  sonatype: http://oss.sonatype.org/content/repositories/snapshots
  uk_maven: http://uk.maven.org/maven2/
  ibibli: http://mirrors.ibiblio.org/maven2/
  repo2: http://repo2.maven.org/maven2/

  comp-maven:http://mvnrepository.com/artifact/
  store_cn:http://maven.oschina.net/content/groups/public/
  store_mir:http://mirrors.ibiblio.org/maven2/
  store_0:http://maven.net.cn/content/groups/public/
  store_1:http://repo.typesafe.com/typesafe/ivy-releases/
  store_2:http://repo2.maven.org/maven2/

  sbt-releases-repo: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  sbt-plugins-repo: http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
  maven-central: http://repo1.maven.org/maven2/

保存。(按Esc, 输入:wq)

此时再第一次执行sbt sbt-version,效果如下:

[root@hidden sbt]# sbt sbt-version
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Getting org.scala-sbt sbt 0.13.13 ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.13/jars/sbt.jar ...
    [SUCCESSFUL ] org.scala-sbt#sbt;0.13.13!sbt.jar (4536ms)
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.6/scala-library-2.10.6.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-library;2.10.6!scala-library.jar (5143ms)
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.13/jars/main.jar ...
    [SUCCESSFUL ] org.scala-sbt#main;0.13.13!main.jar (13976ms)
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.13/jars/compiler-interface.jar ...
    [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.13!compiler-interface.jar (4906ms)
(省略若干....)
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    5 artifacts copied, 0 already retrieved (24494kB/764ms)
[info] Set current project to sbt (in build file:/root/util/sbt/)
[info] 0.13.13

如果出现一部分download成功一部分失败的情况,可以多试几下sbt sbt-version命令,直到只出现:

[info] Set current project to sbt (in build file:/root/util/sbt/)
[info] 0.13.13

说明安装成功。

sbt安装与配置的更多相关文章

  1. Kafka和的安装与配置

    本文主要介绍Kafka的安装与配置: 集群规划 datanode1 datanode2 datanode3 zk zk zk kafka kafka kafka kafka jar包下载地址 http ...

  2. Scala详细环境安装与配置

    https://blog.csdn.net/free356/article/details/72911898 系统为windows.安装配置Scala如下: 一,安装Scala 1,java6以上(建 ...

  3. PlayFramework的安装和配置以及向eclipse导入项目工程

    一.Play的安装和配置 1.首先去官网下载Play的包并将其解压 我下的是playframework2.2.1 2.配置play的环境变量方便使用 3.打开cmd运行play 输入play   he ...

  4. sbt 安装

    此次安装实在windows 下进行的 1.官网下载sbt 2.安装并配置环境变量 path  中添加: 3.更改sbt配置文件 1)修改C:\notos\software\sbt\conf\sbtco ...

  5. JDK安装与配置

    JDK安装与配置 一.下载 JDK是ORACLE提供免费下载使用的,官网地址:https://www.oracle.com/index.html 一般选择Java SE版本即可,企业版的选择Java ...

  6. Node.js 教程 01 - 简介、安装及配置

    系列目录: Node.js 教程 01 - 简介.安装及配置 Node.js 教程 02 - 经典的Hello World Node.js 教程 03 - 创建HTTP服务器 Node.js 教程 0 ...

  7. 烂泥:redis3.2.3安装与配置

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb 前一段时间写过一篇codis集群的文章,写那篇文章主要是因为当时的项目不支持redis自 ...

  8. mysql源码包手动安装、配置以及测试(亲测可行)

    笔记编者:小波/qq463431476博客首页:http://www.cnblogs.com/xiaobo-Linux/ 记下这篇mysql笔记,望日后有用! redhat6采用centos yum源 ...

  9. 环境搭建系列-系统安装之centos 6.5安装与配置

    按照国际惯例,系列目录先奉上: 系列一:系统安装之centos 6.5安装与配置 系列二:准备工作之Java环境安装 系列三:数据为先之MySQL读写集群搭建 系列四:谈分布式之RabbitMQ集群搭 ...

随机推荐

  1. PAT 1026 Table Tennis (30)

    A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For a ...

  2. sql语句的安全性考虑

    sql语句的应该考虑哪些安全性呢? 1.防止sql注入,对特殊字符进行转义(addslashes),或者使用已经编译好的sql语句进行变量的绑定: 2.当sql运行出现错误的时候,不要把数据库返回的错 ...

  3. 3.2 - FTP文件上传下载

    题目:开发一个支持多用户同时在线的FTP程序要求:1.用户加密认证2.允许同时多用户登录3.每个用户有自己的家目录,且只能访问自己的家目录4.对用户进行磁盘配额,每个用户的可用空间不同5.允许用户在f ...

  4. 安装串口设备驱动时遇到 Windows 无法验证此设备所需的驱动程序的数字签名。最近的硬件或软件更改安装的文件可能未正确签名或已损坏,或者可能是来自未知来源的恶意软件. 问题该如何处理?

    win7 系统直接在 cmd 命令行中输入以下语句,重启电脑后重新安装驱动即可. BCDEDIT -SET LOADOPTIONS DISABLE_INTEGRITY_CHECKS BCDEDIT - ...

  5. 提交任务到spark master -- 分布式计算系统spark学习(四)

    部署暂时先用默认配置,我们来看看如何提交计算程序到spark上面. 拿官方的Python的测试程序搞一下. qpzhang@qpzhangdeMac-mini:~/project/spark-1.3. ...

  6. Spring-ApplicationContext容器

    Spring ApplicationContext容器 ApplicationContext是spring中比较高级的容器.和BeanFactory类似,它可以加载配置文件中定义的bean,并将所有b ...

  7. 《浅谈CT》总结

    注明来自 http://www.ssdfans.com/?p=1941 这里说的CT,不是医院里面的CT,而是闪存的一种技术:Charge Trap. 闪存不只有Floating Gate,还有Cha ...

  8. (转)extern关键字两种场景的使用

    第一种场景 -- extern extern关键字的作用是声明变量和函数为外部链接,即该变量或函数名在其它文件中可见.用其声明的变量或函数应该在别的文件或同一文件的其它地方定义. 例如语句:exter ...

  9. Linux系统——本地定制化yum仓库部署

    1)开启yum仓库配置文件 /etc/yum.conf的keepcache功能 (开启一个新的虚拟机) 将keepcache=0改为1,修改配置文件后重新清空缓存(1默认下载的安装包不删除,才可以实现 ...

  10. Java设计原则—里氏替换原则(转)

    里氏替换原则(Liskov Substitution Principel)是解决继承带来的问题. 继承的优点: 代码共享,减少创建类的工作量,每个子类都拥有父类的方法和属性: 提高代码的重用性: 子类 ...