What scala version Intellij Idea scala plugin uses? - scala

I have en error with java annotation on scala enums. This scala bug seems to be fixed, but Inteliij Idea shows an error. So how I can ensure that intellij Idea scala plugin uses actual scala version?

You can check the Scala compiler and language level of your project under your project options from File > Project Structure... > Modules > Scala

I don't know if this has been updated by IntelliJ (currently on 2020.02 version) or not, but it was under:
File > Project Structure > Platform Settings (left tab) > Global Libraries > Scala version"

Related

Downgrading Scala 2.12.3 to Scala 2.10 in Eclipse Scala IDE

I currently have Scala 2.12.3 installed and wish to switch it to 2.10. How would I go about doing this in Eclipse? I could not find any guides on it.
Its in eclipse's settings -> Scala Compiler.
You can try this link,
http://scala-ide.org/blog/scala-installations.html
You can change the scala version used for any project by
right click on project->scala->set the scala installation
you will get list of scala versions supported

Scala compiler library not showing in intellij community edition v15

I have the Scala and SBT plugins enabled (I tried switching off the SBT plugin as well to test) - when I import an existing Play framework project, go to "Project Structure", go to "Modules", select module, then "Dependencies" tab - I do not see the Scala Compiler library options at all over there (I have JDK8 and it is selected as the IDE project JVM and I have Scala and SBT on the computer - Scala v2.11.7 & SBT v0.13.9). Any ideas on what I might be missing? I only see the JDK and Module source under Dependencies but no Scala compiler options.
I am familiar with the IntelliJ blog referencing how to import a play framework project: https://www.jetbrains.com/idea/help/getting-started-with-play-2-x.html
I am only showing the scala sdk in my Global Libraries tab in Project Structure.
Are you not able to build your project in IntelliJ?

`Cannot find symbol` in IntelliJ 14

I have use the IntelliJ Scala plugin before, in 13 and 13.1. I upgraded to 14, and it doesn't work anymore for my SBT project.
For all Scala standard lib stuff, I see errors like "Cannot find symbol scala.Option".
at scala project, compiler error - Cannot resolve symbol List? says I need to have the Scala facet for my module. I looked in facets, and Scala wasn't an option.
I've uninstalled IntelliJ and the Scala plugin and my settings and the projects files multiple times, but still happens.
How do I fix this?
the new scala plugin for intellij 14 removed the facet and replaced it with Scala SDK library, see blog
for sbt project, I guess the best bet is to re-create your project by:
File -> open -> select the build.sbt of your project in popup -> delete existing project and import
I had a similar issue when a Java module calls an Scala object. The issue was from the wrong setup in Source Folders; the Scala source was in src/main/scala/..., but in the Project Structure, the Source Folders were setup as src by default. When I changed it as src/main/scala, the Java module can find the Scala object correctly.
I fixed this by using the nightly builds of the Scala plugin.
The fixes have now been incorporated into the stable versions.
In my case i just had to reload the IDE...

Error: scala: No 'scala-library*.jar' in Scala compiler library

Environment: Play 2.3.0/Scala 2.11.1/IntelliJ 13.1
I used Typesafe Activator 1.2.1 to create a new project with Scala 2.11.1. After the project was created, I ran gen-idea. The generated IDEA project fails to compile with the error:
Error: scala: No 'scala-library*.jar' in Scala compiler library in test
Am I doing something wrong? Workaround?
Open File -> Project Structures -> Libraries, remove any scala sdk in it, e.g. scala-sdk-2.11.8 in the following image.
Click on +, then Scala SDK.
Select the right Scala SDK from the list, for me, it's Ivy-Scala-2.11.8 shown in the picture.
Select the current project(mine is spark-test), click OK.
Then click OK to close it.
Run again, it should work now.
Since IDEA 13 you should use SBT support which is bundled with Scala plugin.
With it there is no need to add third-party SBT plugins and run special commands; just import the project using "File -> Import project..." menu item, and it will automatically load SBT project structure and its dependencies.
I had the same issue with the .idea files generated by ./activator idea with play 2.3. A quick fix is to look in "Project Structure->modules" and note the name of the compiler library. For me it was "SBT: scala2.11.1". The look in "Project Structure->Libraries" and check the contents of this library. It should contain scala-compiler.jar, scala-library.jar, scala-reflect.jar. If this libraries are not present, add them (in my case they are located in ~/.sbt/boot/scala-2.11.1/lib).
For IDEA 15 and project exported from Activator 1.3.5 only Russell's solution helped at the moment.
I have fixed scala compiler library with adding 3 libraries located in ~/.sbt/boot/scala-2.11.1/lib to library's compiler classpath and classes. After indexing project I moved this library to global libraries of IDEA and it was saved there.
I had the same issue.
If you are building your project using external sbt i.e sbt compile then it will create or add dependencies in libraries(all external dependency also) and scala sdk will be added as SBT:scala* based on version of your scala.
So you can remove SDK with SBT as prefix and add proper SDK through Intellij.
File->Project Structure->Libraries
Remove SBT SDK and add it manually.
For me with IDEA 12, I fixed this issue when I unchecked the box for "Use external build" in Settings.Compiler.
now is 2021 year, in Mac, use IntelliJ to run scala:
core logic
Mac: brew install scala
IntelliJ: open *.scala file, then according notice to auto config java JDK and Scala SDK
detailed steps: pls refer another post's answer
I'm an absolute Scala beginner. I was wanting to get up and running. I needed to create a Scala project, not a Java project with Scala library:

how to use a different version of scala library with scala ide 3.0.2?

I've got the newest Scala IDE (3.0.2) and I want to compile my stuff with Scala 2.9.3. I've added that version of Scala as a Maven dependency and removed the default 2.10.0 that the IDE bundles with the new project (not my system Scala version, by the way!). The IDE then tells me Scala is not on the build path, even when I add in the jars to the build path. When I try to add a "Scala Library" through that dialogue, it doesn't give me any options and adds 2.10.0. I've gone through the project settings, and would have expected to see a "Scala version" option, but there isn't (only a "Java version" option.)
My question is this:
How do I add a different version of Scala as the Scala library in Scala IDE 3.0.2 ?
Thanks!
I asked a similar question a while back. Short answer is, you can't.
My post:
Scala-IDE 3.0: 2.9.2 -> 2.10.0