How to change intellij idea for compilation using scala 2.11?

I am using Intellij Idea 13.1.4. I have a scala sbt project. It is currently compiled with scala 2.10. I would like to change this to scala 2.11. In my build.sbt file, I have:

libraryDependencies ++= Seq( "org.scala-lang" % "scala-compiler" % "2.11.0", ... ) 

When I create my project, it is still built as a scala 2.10 project.

Also, under my Project Settings->Modules->Scala->Facet 'Scala'->Compiler library Intellij still shows scala-compiler-bundle:2.10.2 . There is no option for package 2.11.x How do I get an option for scala 2.11.x?

Thanks!

+6
source share
4 answers

In IntelliJ 2016.x you upgrade Scala to

Provide an update to the Scala plugin.

Then move on to:

File | Other settings | Default project structure | Global libraries

Click the + button in the upper left of the window

Choose Scala SDK

Select the version you want to install.

+11
source

I had the same problem as you. I added scala version 2.11 to build.sbt . After that, I removed the default scala SDK using

  • Go to File > Other Settings > Default Project Structures > Platform Settings > Global Libraries
  • Delete scala-sdk-2.10.6

Consequently, IntelliJ will take my scala SDK project (after I do the sbt assembly )

+1
source

You need to add the new scala compiler first to File> Other Settings> Default Project Structure ...

The scala compiler includes:

 <SCALA_HOME>/lib/scala-compiler.jar <SCALA_HOME>/lib/scala-library.jar <SCALA_HOME>/lib/scala-reflect.jar 

Replace the scala installation directory.

Go to File> Project Settings ... and select the newly created compiler library in the Compiler Library. You may need to select scala 2.11 at the language level.

0
source

There is an entry in the .iml file for the scala sdk library, as shown below:

 <orderEntry type="library" name="scala-sdk-2.10.6" level="application" /> <orderEntry type="library" name="scala-sdk-2.11.8" level="application" /> 

comment or delete the scala sdk entry that you do not want.

0
source

Source: https://habr.com/ru/post/974774/


All Articles