17
votes

I am using Kubuntu 14.4, I have Scala 2.9.2 installed and IntelliJ 2016.1 with the Scala plugin in version 3.0.2. When I create a new Scala project (not sbt project) and then right-click on src and then new, I expect the option to create a new Scala worksheet. However, I don't get that option. What do I need to do, to get the option?

PS: In fact I don't get any option related to creating Scala-something.

enter image description here

6
Have you defined the Scala SDK for the project?Yuval Itzchakov
@YuvalItzchakov: How do I do that and how do I check? Can't find the Settings in IntelliJ. I am new to IntelliJ.Make42
@YuvalItzchakov: Thanks, I managed to get it done. If you post an answer how to define the Scala SDK for the project, I will except it.Make42

6 Answers

71
votes

Framework Support needs to be added to the project:

  1. Right click on the project and choose Add Framework Support...
  2. Click on Scala and set the settings.
11
votes

You can go to:

File -> Project Structure -> Global Libraries (tab in left nav. bar)

Clear out any entries (if needed), then add the scala sdk back in. Ensure you click the Download... button. That's it.

enter image description here

1
votes

In version 2020.1 the worksheet option didn't show up because scala plugin was out of date and updating and restarting IDE started showing it.

File > Settings > Plugins > Downloaded > Scala

Hit update and restart IDE.

IDE hangs after restarting (at least for me). I had to kill and restart and like they say, third time was the charm.

1
votes

The existing answers gave me the way.

I post here steps and screenshots specific to IntelliJ Idea Community Edition 2020.3 for Mac.

File menu > Project Structure

enter image description here

Platform Settings > Global Libraries > + sign at the top of the window

enter image description here

Select the Ivy version

enter image description here

And you should get to this point, which is good:

enter image description here

Now you will get Scala Worksheet among the options of "New" from the contextual menu

enter image description here

0
votes

In multi-module maven project, the Framework needs to be added to a specific module as well, entire project doesn't cut it. Also, mark the src/main/scala as Source.

0
votes

File -> Project Structure -> Global Libraries (tab in left nav. bar) and download appropriate scala version