安装sbt

时间:2018-01-06 15:06:14

标签: sbt

我试图在高山脉上安装sbt,

我使用以下方法安装了构建工具:" brew install sbt"之后,我试图在" ./。brew / Cellar / sbt / 1.1.0 / bin / sbt

上运行sbt

我收到了这个错误。

java.io.IOException: Operation not supported
at sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
at sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:90)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1115)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:88)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at xsbt.boot.Launch.locked(Launch.scala:238)
at xsbt.boot.Launch.app(Launch.scala:147)
at xsbt.boot.Launch.app(Launch.scala:145)
at xsbt.boot.Launch$.run(Launch.scala:102)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)

执行sbt时出错:java.io.IOException:不支持操作

1 个答案:

答案 0 :(得分:0)

您实际上不需要自制软件即可安装SBT。直接从https://www.scala-sbt.org/download.html下载它,然后将其解压缩到您的主目录中。

使用终端,更新权限:

chmod -R 700 sbt/bin/sb

打开Bash配置文件。

nano .bash_profile

在文件末尾添加以下行:

export PATH = /用户/用户名/ sbt / bin:$ PATH

用户名是您的用户名。例如,导出PATH = / Users / john / sbt / bin:$ PATH

要测试,请关闭并重新打开终端。运行:

sbt --version

我之前在my blog上写了分步说明。