On a fresh Ubuntu 17.10 installation, I installed scala build tool (sbt) according to the docs:
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
Yet when running sbt, either just to get its version or to build a project, I get this error:
Getting org.scala-sbt sbt 1.1.0 (this may take some time)...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-sbt#sbt;1.1.0
==== local: tried
/home/philipp/.ivy2/local/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
-- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
/home/philipp/.ivy2/local/org.scala-sbt/sbt/1.1.0/jars/sbt.jar
==== local-preloaded-ivy: tried
file:////home/philipp/.sbt/preloaded/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
==== local-preloaded: tried
file:////home/philipp/.sbt/preloaded/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
-- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
file:////home/philipp/.sbt/preloaded/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
-- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
==== sbt-maven-releases: tried
https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
-- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
==== sbt-maven-snapshots: tried
https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
-- artifact org.scala-sbt#sbt;1.1.0!sbt.jar:
https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
==== sbt-ivy-snapshots: tried
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;1.1.0: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.0/sbt-1.1.0.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.0/ivys/ivy.xml
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;1.1.0: not found
Error during sbt execution: Error retrieving required libraries
(see /home/philipp/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 1.1.0
This is my Java version:
$ java --version
openjdk 9-Ubuntu
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)
I have no idea what is happening. How to get sbt up and running again?
In my case, I had to purge:
(Just purging and reinstalling the jdk was not enough, I still had a
java
command after that. Only by purgingjava-common
that also went away and then reinstallation worked.)Afterwards, I reinstalled java again (I opted only for openjdk-9):
This triggered:
Running hooks in /etc/ca-certificates/update.d...
and added a lot of cert files. Now my sbt built was succesful:In my case on Ubuntu 18.04 bionic and sbt 1.1.6, forcing to reinstall
ca-certificates-java
fixes the problem as a workaround.Be careful that
--force-depends
option doesn't damage your installation.