IntelliIdea - Cannot see scala in add framework support

Answered

I want to run scala code in IntelliJ Idea.
I donot see option scala in Add Framework Support. Therefore i don't see option to create scala class.

I had posted the same question on StackOverFlow but i couldn't get answer.

 

Please suggest how to do it?

 

 

3 comments
Comment actions Permalink

Your source root is not configured correctly, please see https://www.jetbrains.com/help/idea/configuring-content-roots.html. `src/main/scala` directory needs to be configured as the Sources root (marked in blue in the project view), you can right click on this directory to mark it as such.

If your project is Maven based, you need to update the pom.xml configuration so that IDE knows the project has Scala source roots: https://bl.ocks.org/tyrcho/a4c0f0240e52f7e0802a.

Relevant lines from this sample:

	<build>
		<sourceDirectory>src/main/scala</sourceDirectory>
		<testSourceDirectory>src/test/scala</testSourceDirectory>

You cannot see Scala in Add Framework support because it's already added and the issue is with the source roots configuration, not with the framework.

1
Comment actions Permalink

Thanks Serge,

It works.

0
Comment actions Permalink

You can install the Scala plugin from plugin option,  then restart the IDE and it will be available under Groovy. I faced same problem and this worked, Hope it will work for you as well.

Go to File->Settings->Plugins->Search "Scala"-> click install->Restart the IDE

Now follow the previous steps you followed "Scala" will be available in the "Add Framework Support" option.

 

 

 

0

Please sign in to leave a comment.