25

IntelliJ 14 supports (in theory) SBT / Scala projects through the Scala plugin, which is still available in the official repo. According to this post "Scala plugin project itself now uses SBT for build and dependency management". However I cannot find any way to create or import a SBT / Scala project with IntelliJ. There is also a lack of documentation explaining more about this new way of configuring the Scala Plugin.

I have the Scala plugin activated in the IntelliJ Ultimate 14.0 (139.224). Any ideas?

Bastien Jansen
  • 8,756
  • 2
  • 35
  • 53
Pablo R. Mier
  • 719
  • 1
  • 7
  • 13

4 Answers4

41
  1. Install scala plugin. Settings -> Plugins -> Scala -> Install
  2. Open directory with sbt build: File -> Open Project -> select directory with build.sbt -> configure settings

That worked for me just a couple of minutes ago. It may be necessary to reset cache and restart: File -> Invalidate Caches / Restart.

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
Eugene Zhulenev
  • 9,714
  • 2
  • 30
  • 40
  • 3
    It works with IntelliJ Community but not with the Ultimate version. It seems that the Scala plugin is incompatible with the Ultimate version. – Pablo R. Mier Nov 05 '14 at 22:07
  • I upgraded from Idea 13 to 14 today. Since then, my source code looks like hell, all covered in red. Idea 14 appears not to know what a Seq or List is. Funny thing is, my code will compile and run. It just displays as though it's suddenly full of errors. I downloaded/installed the Ultimate version. If it doesn't get resolved soon I guess I'll go back to Idea 13. – gknauth Nov 05 '14 at 22:49
  • 1
    hm... I'm still on latest EAP, and another guy in our office looks like has the same problems with 14 – Eugene Zhulenev Nov 05 '14 at 22:50
  • 3
    In addition to Eugene's steps, I also had to Invalidate Caches. File > Invalidate Caches / Restart... – Jono Nov 25 '14 at 15:58
  • 1
    This solution, with the addition of the tip by @Jono worked for me -- but first I had to uninstall the SBT plugin inherited from a previous version. – lre Nov 25 '14 at 22:01
  • I can confirm this also worked, but the step suggested by @Jono was crucial. – Andrew Bate Jan 10 '15 at 18:49
7

I've finally figured out the exact problem. IntelliJ loaded the default settings of the previous version, including the old version of the Scala plugin. The problem was fixed uninstalling the old Scala plugin and following the steps posted by Eugene Zhulenev

Pablo R. Mier
  • 719
  • 1
  • 7
  • 13
3

Make sure you have the scala plugin for intellij. Go file>new>'project from existing source', select your project to import. Go to build.sbt and there should be a prompt to import the packages. Sometimes, you can try to file>synchronise or file>'invalidate cache and restart'.

kklw
  • 858
  • 3
  • 13
  • 28
1

I tried the following steps but they didn't help:

  • Invalidate cache and restart IntelliJ
  • Close the project and re-import the project
  • Uninstall the Scala plugin and reinstall it

Eventually, I removed the target folders in the project, and re-imported it. Then it worked.

z11i
  • 951
  • 11
  • 26