• Linux中安装sbt


    sbt下载官网地址:https://www.scala-sbt.org/download.html

    一、Ubuntu安装

    echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
    echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
    curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
    sudo apt-get update
    sudo apt-get install sbt

    二、Centos安装

    # remove old Bintray repo file
    sudo rm -f /etc/yum.repos.d/bintray-rpm.repo
    curl -L https://www.scala-sbt.org/sbt-rpm.repo > sbt-rpm.repo
    sudo mv sbt-rpm.repo /etc/yum.repos.d/
    sudo yum install sbt

    三、测试

    // 查看下载版本
    // 第一次执行时,会下载一些文件包,然后才能正常使用,需要确保是联网的
    sbt sbtVersion

    新建scala源文件测试

    object HelloScala extends App {
      println("Hello Scala")
    }
    sbt run
    
    [root@alwaysdayone ~]# sbt run
    [info] welcome to sbt 1.6.2 (Oracle Corporation Java 1.8.0_281)
    [info] loading project definition from /root/workspace/chisel_leaning/project
    [info] set current project to chisel_leaning (in build file:/root/workspace/chisel_leaning/)
    [info] compiling 1 Scala source to /root/workspace/chisel_leaning/target/scala-2.12/classes ...
    [info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.15. Compiling...
    [info]   Compilation completed in 8.652s.
    [info] running HelloScala 
    Hello Scala
  • 相关阅读:
    RTOS双向链表数据结构
    [LintCode] Majority Number(以时间复杂度O(n)求主元素)
    [LintCode] Median(期望时间复杂度O(n)求中位数和第k大数)
    [LintCode]unique paths with obstacles
    [LintCode]unique paths
    [LintCode]sqrt(x)
    排序算法(C++实现)
    优先队列C++实现
    散列之分离链接法
    AVL树C++实现
  • 原文地址:https://www.cnblogs.com/Ao0216/p/16409344.html
Copyright © 2020-2023  润新知