Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Error during sbt execution: No Scala version specified or detected" with SBT from Homebrew

I have installed Scala 2.10.3 and SBT 0.13.1. When I execute SBT following Hello, World from the SBT documentation I get the following error message:

"Error during sbt execution: No Scala version specified or detected"

I've tried to add a build.sbt file with the scalaVersion but the error keeps showing up.

Please advise.

I've just downgraded sbt to 0.12.3 and it works ... so what's wrong with 0.13.X ?

like image 976
user3289431 Avatar asked Feb 09 '14 11:02

user3289431


2 Answers

Its not an issue with the upgrade of 0.13.* version. Its the repository cache thats causing the issue. There are possibilities where you have broken / no ivys (when only the jar is downloaded through maven repo) for the sbt jars in your cache.

Once upgraded remove your ivy repo cache (or rename the folder) and remove the .sbt/boot folder (removing this will enable to start from the scratch)

Edit your ./sbt/repositories file and provide preference to the ivy repositories. If you are using proxy repositories which includes both ivy and maven style artifacts, the add it as below

[repositories]

local

maven-local

maven-central-ivy: http://<repository url>, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

maven-central: http://<repository url>

This will enable especially (org.scala-sbt/sbt/*) to be download with the Ivys xml from where the version / revision and dependencies are picked up for the builds. If only the jar is downloaded from "maven-central", then the error occurs.

like image 65
Gopi Avatar answered Oct 22 '22 05:10

Gopi


It is the problem of IDE you are using specially the scala plugin in it. You can get ride of this just go to the folder where the build.sbt is created. Delete the "project" folder and open cmd, run "sbt" command on the folder, a new project folder will be created. Now you can open that in IDE. It may be that you may find some problem very first in ide, if you build the project once , all the problems will go away.

like image 41
John Avatar answered Oct 22 '22 04:10

John