newbie sbt question

I'm just trying IDEA for the first time, and I am trying to work with a Scala application that I wrote, using sbt to build it. I loaded the Scala and SBT plugins. I am trying to create a new SBT (Scala) project, but I am not sure what I am supposed to put for project location. I have a standard directory structure. Am I supposed to use the directory where build.sbt is (with lib, src, target, and project)? Thanks.

3 comments
Comment actions Permalink

You can choose File -> Import Project from IDEA menu. Then you can choose your build.sbt file to import your project. IDEA will put .idea directory directly to the same directory, where build.sbt is located. IDEA will read your standard directory structure from your build.sbt file.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Thanks for the help. When I try to build the project it tells me that no SDK has been specified. Doesn't SBT normally have it's own copy of the compiler available to use? I have been using "sbt compile" for a long time, and it has worked fine. Shouldn't it just use the same one when I build?

0
Comment actions Permalink

You need to choose Java SDK for your project (Project Settings -> Project -> Project SDK). Not only build requires it, right highlighting and completion also require it.
SBT uses JAVA_HOME to build. In fresh IDEA installation you always need to setup first Java SDK.

Best regards,
Alexander Podkhlayuzin.

0

Please sign in to leave a comment.