2016-12-25 10 views
2

ubuntu 16.10にsbtをインストールする際に問題があります。 Open JDK 1.9をインストールしました。私は、Unixのため、ここからの指示に従っ:UbuntuでOpen JDK 1.9を使ってubuntuにsbt 0.13.8または最新バージョンをインストールするには

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

私は〜/ .bashrcに以下をファイルに追加:

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は、私の知る限り、それはjava9と互換性がありません2016年12月28日までに、持っていました同じ問題とどのような私のために働いたが

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 

を次のようにOpenJDKの-9をアンインストールした最初、その後私は、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

はい、私もそれを見つけました –

0

Dockerコンテナlibrary/openjdk:9でMavenを実行しようとしたときにこれがヒットしました。 Q:java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.JceSecurityManagerの他のコメント作成者と同じ方法で、OracleからJava 9 JDKを入手してhttps://jdk9.java.net/download/に設定し、JAVA_HOMEと設定して解決しました。これらの2つのjarファイル(他の回答に記載されている)はDockerイメージに存在しないようです。

関連する問題