Avi
Avi

Reputation: 2283

Problems to use scala code project in IntelliJ IDEA 15

I installed IntelliJ IDEA 15 in order to use it for Scala. When I defined the directories for the project I can't add New Scala code, it doesn't appear and the box icon near Scala didn't change its color to blue. As can be seen:

enter image description here

I defined a JDK in the project structure:

enter image description here

And the Scala is installed:

enter image description here

Upvotes: 0

Views: 82

Answers (1)

Ali Dehghani
Ali Dehghani

Reputation: 48193

In order to make your scala directory a Source directory, right click on the scala directory, then from the Mark Directory As sub-menu, select the Sources Root:

enter image description here
Sources Root in IDEA

I guess you should make your project folder as Sources Root as well.


Creating a Scala Project Using Typesafe Activator

In order to create a scala project using activator templates, first download the latest version of activator from here. Then, extract the downloaded archive on wherever location you want and go to that location and type activator ui on the command line. After a few seconds, activator ui will be started at http://localhost:8888:

enter image description here Typesafe Activator UI

In the Activator UI, select the Hello Scala template, then change the destination folder and finally hit the Create App button. Activator will clone the project template into your desired location. Then open the IDEA and Select Import Project from the welcome screen and select the project folder. From the Import Project window check the Import project from external model and select SBT and hit Next and Finish after that:

enter image description here Import Project

Then, after downloading required dependencies by SBT, you can start coding in scala!

Upvotes: 2

Related Questions