126

Similar problem with How to use sbt behind authenticated proxy?. I tried with the given answer and problem still there.

When I run sbt in terminal, it shows and stucks at :

Getting org.scala-sbt sbt 0.13.6 ...

additional information:

 sbt --version
 sbt launcher version 0.13.6

How could I fix it?

Community
  • 1
  • 1
HappyCoding
  • 4,529
  • 7
  • 25
  • 46

8 Answers8

213

This is quite old post and my answer may not be completely relevant. But here is my experience:

  1. I am using sbt 0.13.8
  2. Getting org.scala-sbt sbt 0.13.8 ...
  3. I have got this line hanging for some time - between 5 to 10 minutes.
  4. And then it started to download stuff.

So my solution is that you have to wait a bit.

gsamaras
  • 66,800
  • 33
  • 152
  • 256
Hakobyan Vahe
  • 2,279
  • 1
  • 11
  • 3
  • 23
    Thanks! I was "waiting" while looking up the problem and reading this page. Now I checked the window again, and it's downloading all the jars... *sloooowwwlllyyyy* `:)` – ADTC Aug 06 '15 at 04:31
  • 47
    Running sbt in verbose mode helped me determine that there were some downloads happening that just weren't visible to me, e.g., `$ sbt -v` – Derek Oct 05 '15 at 14:38
  • 3
    If you're here, like me, you probably have a slow internet connection :) – gak Jan 27 '16 at 08:20
  • 5
    You can also try to hit "Enter" after couple of minutes :) In my case - it instantly started to download jars. – Ziemo Apr 07 '16 at 23:31
  • Sometimes sbt stuck when downloading files. You can periodically check size ~/.ivy2 folder and if size isn't grow kick sbt process and rerun sbt. For my only after 5 kicks sbt download all files!!! – Andrey Pushin Apr 13 '16 at 10:37
  • Waiting...kale. – jlucky Dec 18 '16 at 11:18
  • Thanks buddy, I did the same approach. Slowly and steadly getting downloaded!! :) – Santhucool Aug 02 '17 at 05:40
  • Stuck over 20 minutes on my Mac... `:(` Just have to wait – Mitrakov Artem Mar 27 '18 at 11:44
  • It turns out that repo.typesafe.com is sometimes really slow. You just have to wait I guess. – Ruurtjan Pul Oct 11 '18 at 13:29
43

There is an update log ...

$ tail -f $HOME/.sbt/boot/update.log 

Execute the above command in another terminal to see the progress. Using -v option works as others already indicated as well.

Nicolás Ozimica
  • 8,562
  • 5
  • 34
  • 49
Thava
  • 1,393
  • 15
  • 13
13

I bypassed the error by adding a build.properties file under project folder, in which, I put:

  sbt.version=0.13.5

I think this probably is because my system has activator pre-installed instead of sbt, which is easier to work with play project. Not quite clear in the theory as I just start to use sbt.

HappyCoding
  • 4,529
  • 7
  • 25
  • 46
  • Worked for sbt 0.13.8 too! – akhmed Jun 20 '15 at 04:47
  • It worked for me too. The project declared in the project/build.properties file that it required 0.13.8 and the command was getting stuck trying to get it. Changing the declaration to 0.13.7 fixed it. – Igor Rodriguez Jul 03 '15 at 10:12
  • 1
    I think this works only if you already have the specified version (0.13.5, in this case) of sbt downloaded. For example, I have ~/.sbt/boot/scala-2.10.4/org.scala-sbt/sb/0.13.1 and ~/.sbt/boot/scala-2.10.5/org.scala-sbt/sb/0.13.9, and my sbt program is sbt-0.13.13.1-1.noarch, sbt will not try "Getting org.scala-sbt sbt 0.13.13 ..." if a set sbt.version=0.13.1 or sbt.version=0.13.9. It's also possible to set sbt version with CLI options: # sbt version (default: from project/build.properties if present, else latest release) -sbt-version use the specified version of sbt – Zhiyong Jan 12 '17 at 05:55
  • At least I am able to see logs being printed. After 10 minutes or so it started to download. – Aneel Ansari Nov 07 '18 at 08:20
12

It is downloading things, just use $ sbt -v, it will show logs.

Ole V.V.
  • 65,573
  • 11
  • 96
  • 117
maroon912
  • 311
  • 2
  • 8
  • `sbt -v` is better than `tail -f $HOME/.sbt/boot/update.log` sometimes, when `sbt -v` log something while the other not. – Lebecca Mar 15 '20 at 08:54
9

I think sbt takes some time to download its jars when it is run first time. That is why it seems to be stuck. It works normal after the download is completed.

Rohan
  • 169
  • 3
  • 3
3

It's quite a late answer, but I encountered the same problem working behind a proxy. If this is your case, you should run export JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=<your-proxy> -Dhttp.proxyPort=<your-proxy-port>" before running sbt.

If you are still unsure if it's going ahead with the downloading, you should try launching sbt with the verbose option sbt -v, as suggested by @evan912. If you had a problem with the proxy, after setting it you should see some [info] downloading logging on your console.

Andrea
  • 3,322
  • 3
  • 28
  • 45
1

Creating a build.sbt file worked as well. My build.sbt file looks like below;

lazy val root = (project in file(".")).
  settings(
    name := "hello",
    version := "1.0",
    scalaVersion := "2.11.4"
  )
Jerome Anthony
  • 7,203
  • 2
  • 36
  • 26
-2

try to use a fast maven mirror or run it behind a http/https proxy .

jack long
  • 13
  • 2