53

This question may sound silly for you, but I have been searching the Internet for a while and couldn't find the answer. How can I open SBT Tool Window in Intellij (scala and SBT plugins obviously installed)?

Valy Dia
  • 2,781
  • 2
  • 12
  • 32
DorianOlympia
  • 841
  • 1
  • 10
  • 22

7 Answers7

60

In Menu: View -> Tool Windows there should be two entries:

  1. SBT
  2. SBT Console

The first you can use to refresh IDEA project structure from SBT and view dependencies.

The second gives you a console where you can run sbt commands.

Update:

As Justin already aded:

As of IntelliJ IDEA 2017.1 Build #IC-171.3780.52 there is a new and (imho) better way:

(If you are working with an SBT project, that is)

When you open the SBT Tool Window, you will find a new scala terminal icon:

enter image description here


This will open an sbt console session with your sbt project import settings.

One major benefit is that you will actually (finally) get links to your code lines for compiler warnings and errors.

Sascha Kolberg
  • 7,092
  • 1
  • 31
  • 37
  • 18
    I don't see "SBT Console" menu item in my Intellij, version 16. – Marek Dudek May 28 '16 at 09:27
  • 2
    SBT item usually comes hidden after project restart, so idea project files come not syncronized with sbt ones. How to force the SBT entry to show up? – WebComer Aug 02 '16 at 22:07
  • Beacuse of "SBT Console" does not appear in my case also, I'll want to give a link to Marek Dudek's solution below, which works for me. – Hartmut Pfarr Dec 09 '16 at 16:37
  • 1
    If you don't have this option, it's because you haven't installed the SBT plugin. The Scala plugin may give you the basic SBT side menu -- **but not the console**. I would not recommend following the other answers which suggest using the Terminal window `Alt-F12`. This will use your installed copy of SBT instead of the bundled copy (this can lead to dependencies being resolved in each instance, etc.) – RawToast Jan 14 '17 at 14:30
11

To be able to open SBT Console from View -> Tool Windows you first need to install the plugin required for it.

You can find the SBT plugin by searching for it under Settings -> Plugins -> Browse repositories

Plugin homepage: https://github.com/orfjackal/idea-sbt-plugin

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
4

In IntelliJ 2017.1, an sbt shell is integrated with the Scala plugin. You can open it from an icon on the sbt project view toolwindow, or from the "Tools" menu enter image description here

Justin Kaeser
  • 5,868
  • 27
  • 46
2

In Intellij 16 SBT Console menu item no longer exists and in Debian 7 (XFCE) Alt-F12 doesn't work.

To run SBT console:

  1. select View -> Tool Windows -> Terminal (for Alt-F12)
  2. type sbt and console works
Marek Dudek
  • 171
  • 1
  • 13
  • I don't have the `Terminal` tool window in my IntelliJ 16 `Tool Windows` menu. Perhaps it comes from a plugin? – jbyler Oct 11 '16 at 17:32
1

You can either use above or simply use Alt+F12

Prasad
  • 616
  • 7
  • 11
1

I had an issue where the sbt shell launcher was not on the bottom of the IDE and the sbt was not listed as an option under Tools. Discovered that the issue was after expanding a zip file of a scala project to my workspace, the build.sbt file was not in the root folder of the project structure, but nested one subfolder down. When importing this project into intellij it was not properly configuring it as an sbt project. After removing the project, exploding the zip in such a way that the build.sbt was in the root of the project and reimporting the issue was resolved.

James Gawron
  • 871
  • 10
  • 27
0

I had a similar, but slightly different issue. First, I didn't have the Scala plugin installed on my version of IntelliJ. Once done, I restarted the app. Then created a new project (even though I was trying to open an existing one). When creating the project I made sure to put the root directory of the project as the root folder of the project I wanted to import (the one that has the sbt file). IntelliJ synched my new project with the existing one and I was good to go.

jasonweidner
  • 49
  • 1
  • 8