2016-12-25 53 views
2

我在ubuntu 16.10上安裝sbt時遇到問題。我已經安裝了Open JDK 1.9。我跟着從這裏Unix的說明:我添加到我的〜/ .bashrc文件如下如何在Ubuntu上使用Open JDK 1.9安裝sbt 0.13.8或最新版本

http://www.scala-sbt.org/release/docs/Manual-Installation.html

JAVA_HOME="/usr/lib/jvm/java-1.9.0-openjdk-amd64" 
SBT_HOME="$HOME/sbt-launcher-packaging-0.13.13" 
PATH="$SBT_HOME/bin/sbt":$PATH 

當我從命令行運行SBT我得到一個無法識別的命令錯誤。 如果我把JAR文件,並在/ bin中的SBT腳本/和運行我得到這個錯誤:

Getting org.scala-sbt sbt 0.13.8 ... 
java.lang.ExceptionInInitializerError 
    at javax.crypto.JceSecurityManager.<clinit>([email protected]/JceSecurityManager.java:65) 

at javax.crypto.Cipher.getConfiguredPermission([email protected]/Cipher.java:2595) 
at javax.crypto.Cipher.getMaxAllowedKeyLength([email protected]/Cipher.java:2619) 
at sun.security.ssl.CipherSuite$BulkCipher.isUnlimited([email protected]/CipherSuite.java:602) 
at sun.security.ssl.CipherSuite$BulkCipher.<init>([email protected]/CipherSuite.java:574) 
at sun.security.ssl.CipherSuite$BulkCipher.<clinit>([email protected]/CipherSuite.java:460) 
at sun.security.ssl.CipherSuite.<clinit>([email protected]/CipherSuite.java:1074) 
at sun.security.ssl.SSLContextImpl.getApplicableSupportedCipherSuiteList([email protected]/SSLContextImpl.java:353) 
at sun.security.ssl.SSLContextImpl.access$100([email protected]/SSLContextImpl.java:41) 
at sun.security.ssl.SSLContextImpl$AbstractTLSContext.<clinit>([email protected]/SSLContextImpl.java:582) 
at java.lang.Class.forName0([email protected]/Native Method) 
at java.lang.Class.forName([email protected]/Class.java:291) 
at java.security.Provider$Service.getImplClass([email protected]/Provider.java:1844) 
at java.security.Provider$Service.newInstance([email protected]/Provider.java:1820) 
at sun.security.jca.GetInstance.getInstance([email protected]/GetInstance.java:236) 
at sun.security.jca.GetInstance.getInstance([email protected]/GetInstance.java:164) 
at javax.net.ssl.SSLContext.getInstance([email protected]/SSLContext.java:166) 
at javax.net.ssl.SSLContext.getDefault([email protected]/SSLContext.java:98) 
at javax.net.ssl.SSLSocketFactory.getDefault([email protected]/SSLSocketFactory.java:123) 
at javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory([email protected]/HttpsURLConnection.java:332) 
at javax.net.ssl.HttpsURLConnection.<init>([email protected]/HttpsURLConnection.java:289) 
at sun.net.www.protocol.https.HttpsURLConnectionImpl.<init>([email protected]/HttpsURLConnectionImpl.java:85) 
at sun.net.www.protocol.https.Handler.openConnection([email protected]/Handler.java:62) 
at sun.net.www.protocol.https.Handler.openConnection([email protected]/Handler.java:57) 
at java.net.URL.openConnection([email protected]/URL.java:1049) 
at org.apache.ivy.util.url.BasicURLHandler.getURLInfo$57a0216e(BasicURLHandler.java:66) 
at org.apache.ivy.util.url.BasicURLHandler.getURLInfo(BasicURLHandler.java:54) 
at org.apache.ivy.plugins.repository.url.URLResource.init(URLResource.java:65) 
at org.apache.ivy.plugins.repository.url.URLResource.exists(URLResource.java:81) 
at org.apache.ivy.plugins.resolver.RepositoryResolver.findResourceUsingPattern(RepositoryResolver.java:97) 
at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findResourceUsingPatterns(AbstractPatternsBasedResolver.java:96) 
at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findIvyFileRef(AbstractPatternsBasedResolver.java:66) 
at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:228) 
at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104) 
at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169) 
at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:292) 
at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:714) 
at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:799) 
at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:722) 
at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:594) 
at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:234) 
at xsbt.boot.Update.xsbt$boot$Update$$lockedApply(Update.scala:106) 
at xsbt.boot.Update$$anon$4.call(Update.scala:100) 
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.Update.apply(Update.scala:101) 
at xsbt.boot.Launch.update(Launch.scala:352) 
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.SecurityException: Can not initialize cryptographic mechanism 
    at javax.crypto.JceSecurity.<clinit>([email protected]/JceSecurity.java:91) 
    ... 78 more 
    Caused by: java.lang.NullPointerException 
     at sun.nio.fs.UnixPath.normalizeAndCheck([email protected]/UnixPath.java:75) 
     at sun.nio.fs.UnixPath.<init>([email protected]/UnixPath.java:69) 
     at sun.nio.fs.UnixFileSystem.getPath([email protected]/UnixFileSystem.java:280) 
     at java.nio.file.Paths.get([email protected]/Paths.java:84) 
     at javax.crypto.JceSecurity.setupJurisdictionPolicies([email protected]/JceSecurity.java:254) 
     at javax.crypto.JceSecurity.access$000([email protected]/JceSecurity.java:49) 
     at javax.crypto.JceSecurity$1.run([email protected]/JceSecurity.java:82) 
     at javax.crypto.JceSecurity$1.run([email protected]/JceSecurity.java:79) 
     at java.security.AccessController.doPrivileged([email protected]/Native Method) 
     at javax.crypto.JceSecurity.<clinit>([email protected]/JceSecurity.java:78) 
     ... 78 more 
    Error during sbt execution: java.lang.ExceptionInInitializerError 

回答

2

SBT據我所知,到目前爲止2016年12月28日它不與java9兼容,有什麼工作對我來說同樣的問題首先卸載OpenJDK的-9如下

sudo apt-get autoremove openjdk-9-jre-headless 

sudo apt-get remove default-jdk 

sudo apt-get purge openjdk-9-jre-headless gcj-4.9-jre-headless 

,然後因爲我有java的8已經安裝

> ~$ java -version 
openjdk version "1.8.0_111" 
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.10.2-b14) 
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode) 

我按照從過程sbt page和一切按預期工作

+0

是的,我發現也是 –

相關問題