Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems Importing Scala Libraries In Intellij

I am trying to import a project into intellij. I am using a java sdk and am trying to import the scala libraries. When I try to run my code I get

Warning:scala: skipping Scala files without a Scala SDK in module(s) main

When I try to add the scala libray:

File>Project Structure>Global Libraries>+>scala-sdk(2.11.7)>Apply

I get another error message:

Module "lab1"
must not contain source root "C:\Users\Andrew\lab1\src\main\scala".
The root already belongs to module "main"

This is my first time using this IDE so I am a bit lost.

like image 381
BashOverride Avatar asked Jan 14 '16 19:01

BashOverride


People also ask

How do I add Scala files to IntelliJ?

To install Scala plugin, press Ctrl+Alt+S , open the Plugins page, browse repositories to locate the Scala plugin, click Install and restart IntelliJ IDEA. Now you can successfully check out from VCS, create, or import Scala projects.

How do I select Scala version in IntelliJ?

Press Ctrl+Alt+S to open Settings/Preferences dialog. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.


1 Answers

I resolved this within the IDE (IntelliJ 2016.2.4) by adding the correct framework support. See this link for more information.

like image 135
Steven Holtzen Avatar answered Oct 13 '22 05:10

Steven Holtzen