Reputation:
Intellij Idea add Scala support to existing Java project. Just cannot figure it out How to add Scala worksheet to existing Java project? It would be just nice to have Scala REPL or worksheet. But after resiarsh and trying I failed to do that.
Upvotes: 8
Views: 7616
Reputation: 5934
If you want add a "Scala sub-project" into your Java project, you can use the "New Module" functionality.
To do this...
This will do all the setup work needed for you to have a Scala project.
Protip:
You will want to change the line within the automatically generated build.sbt (lazy val root = (project in file(".")
) to something like...
lazy val root = (project in file("scalasubprojectfoldername")
This will ensure the project
and target
folders will remain in the Scala sub-project, as opposed to being placed into the root Java project.
Upvotes: 1
Reputation: 170919
To add Scala support to existing module:
- Right-click the module in Project View, choose “Add Framework Support…”
- Check “Scala” in technologies list (unavailable if module has Scala facet attached)
- Provide a path to Scala installation (if not detected)
From http://blog.jetbrains.com/scala/2010/09/02/project-configuration-explained/.
Upvotes: 14