2016-11-28 83 views
0

我嘗試下載並使用在RedHat運行SBT:不能運行SBT在RedHat

curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo 
sudo yum install sbt 

,我得到這個錯誤

java.lang.ExceptionInInitializerError 
    at xsbt.boot.Update.settings$lzycompute(Update.scala:76) 
    at xsbt.boot.Update.settings(Update.scala:71) 
    at xsbt.boot.Update.ivyLockFile$lzycompute(Update.scala:93) 
    at xsbt.boot.Update.apply(Update.scala:100) 
    at xsbt.boot.Launch.update(Launch.scala:350) 
    at xsbt.boot.Launch.xsbt$boot$Launch$$retrieve$1(Launch.scala:208) 
    at xsbt.boot.Launch$$anonfun$3.apply(Launch.scala:216) 
    at scala.Option.getOrElse(Option.scala:120) 
    at xsbt.boot.Launch.xsbt$boot$Launch$$getAppProvider0(Launch.scala:216) 
    at xsbt.boot.Launch$$anon$2.call(Launch.scala:196) 
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93) 
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78) 
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97) 
    at xsbt.boot.Using$.withResource(Using.scala:10) 
    at xsbt.boot.Using$.apply(Using.scala:9) 
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58) 
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48) 
    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) 
Caused by: java.lang.RuntimeException: The SHA1 algorithm is not available in your classpath 
    at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.<clinit>(DefaultRepositoryCacheManager.java:86) 
    ... 29 more 
Caused by: java.security.NoSuchAlgorithmException: SHA1 MessageDigest not available 
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:159) 
    at java.security.Security.getImpl(Security.java:695) 
    at java.security.MessageDigest.getInstance(MessageDigest.java:167) 
    at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.<clinit>(DefaultRepositoryCacheManager.java:84) 
    ... 29 more 
Error during sbt execution: java.lang.ExceptionInInitializerError 

我不知道哪裏錯誤的來源。它在sbt初始化本身是錯誤的嗎?

由於這是從官方網站安裝sbt的推薦方式,所以您推薦在redhat上安裝sbt的其他方式是什麼?

+1

的可能的複製[爲什麼執行激活給予的ExceptionInInitializerError造成:java.security.NoSuchAlgorithmException:SHA1消息摘要不可用(http://stackoverflow.com/questions/27945464/why-does-executing-activator-give -exceptionininitializererror-caused-by-java-se) – danielnixon

回答

1

我最終通過將bouncy castle jar安裝到我的jvm安裝中解決了這個問題,這些安裝不在我的RedHat vms中。

0

我個人比較喜歡最新的SBT版本和適當的包裝器運行腳本。 Paul Phillips(Scala lang的貢獻者之一)寫了一個非常好的腳本。我只是有一點點的shell腳本get_sbt.sh是下載我的最新版本:

#!/bin/bash 

# Downloads the latest version of SBT runner script which in turn downloads 
# SBT launcher JAR and provides lots of convenience methods. 

curl -s https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt > sbt && chmod 0755 sbt 

您可以像這樣運行:

./get_sbt.sh

它會下載亞軍腳本到當前目錄,後來才運行與亞軍腳本:

./sbt

這反過來會下載最新的SBT JAR,而其他任何需要的將從這裏引導。

+0

感謝您的提示,我沒有考慮這個問題。 – UtsavShah