7
votes

I got a problem when I setup sbt. I had download a "zip",and expand it,but when I run sbt command,errors occured.

    module not found: org.scala-sbt#sbt;0.13.8

==== local: tried

  /home/zhang1/.ivy2/local/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml

  -- artifact org.scala-sbt#sbt;0.13.8!sbt.jar:

  /home/zhang1/.ivy2/local/org.scala-sbt/sbt/0.13.8/jars/sbt.jar

==== typesafe-ivy-releases: tried

  https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml

==== Maven Central: tried

  https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom

  -- artifact org.scala-sbt#sbt;0.13.8!sbt.jar:

  https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar

    ::::::::::::::::::::::::::::::::::::::::::::::

    ::          UNRESOLVED DEPENDENCIES         ::

    ::::::::::::::::::::::::::::::::::::::::::::::

    :: org.scala-sbt#sbt;0.13.8: not found

    ::::::::::::::::::::::::::::::::::::::::::::::

:::: ERRORS Server access Error: Connection timed out url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml

Server access Error: Connection timed out url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom

Server access Error: Connection timed out url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar

How can I fix this?

1
find sbt-launch.jar under bin directory,edit the file "sbt.boot.properties" under sbt dirctory ,and replace "https" with "http". Maybe something related with GFW?yuxh

1 Answers

1
votes

I'd the same issue, I checked http,https,ftp proxies by

env | grep "http_proxy" 

it returns the right value but this is not enough. I checked it in .bashrc file , still I was facing the same issue then I open sbt file and add JVM_OPT

-Dhttp.proxyHost=proxy.cnw.co.nz       
-Dhttp.proxyPort=8080   
-Dhttps.proxyHost=proxy.cnw.co.nz       
-Dhttps.proxyPort=8080 
-Dftp.proxyHost=proxy.cnw.co.nz       
-Dftp.proxyPort=8080 

with the help of this how-to-use-sbt-from-behind-proxy

and finally hit the java to launch the sbt

java $JVM_OPTS -jar $SBT_LAUNCHER $SBT_OPTS