score:12
This question puts me on the way
so I check the JDK version and surprisingly IntelliJ and Nailgun didn't run with the same JDK.
~ ❯❯❯ ps -ef | grep java
501 2290 2017 0 4:12PM ?? 0:01.81 /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java … org.jetbrains.plugins.scala.nailgun.NailgunRunner 3200 6a73f540-1a80-476d-96d2-83ab8faaad95
501 2291 2017 0 4:12PM ?? 0:02.15 /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java …
So I searched in the IntelliJ preferences and found out that Scala Compile Server was configured with an old JDK : 1.8.0_11. Bim !
I've just unchecked the checkbox Use external compile server
score:0
Note that in scala-2.12, scala binary file is a wrapper script.
It looks like your JAVA_HOME directory is not correctly set.
Take a look at line that reads (inside $SCALA_HOME/bin/scala):
java_release="$(cat $JAVA_HOME/release | grep JAVA_VERSION)"
Based on your output, it looks like JAVA_HOME is not set. What you get is:
cat: /release: No such file or directory
score:0
Late to the party but another possible solution for someone for whom the above answers are not working:
- Right click on your project and select module settings (for mac the shortcut is usually CMD + down arrow key)
- in the sidebar select Global libraries
- make sure that the correct scala SDK version is present. if not delete the existing one with the - button and add the correct sdk corresponding to the scala version in your pom.xml/ build.sbt using + button
a mismatch of scala version that intellij provides and the one defined by you in your build file can also cause this error.
score:1
go to editconfiguration in intellij and choose in JRE drop down the jdk version which is installed in your system. and do rebuild, It worked for me.
Source: stackoverflow.com
Related Query
- How to get rid of scalac ServerException with IntelliJ Idea
- How to get Scala imports working in IntelliJ IDEA with the Play framework?
- How do I get Intellij IDEA 12.0 to work with Play Framework 2.1.0 app and Scala 2.10.0?
- How to get IntelliJ IDEA 14 working with Scala on Android (SBT)
- How to use Scala in IntelliJ IDEA (or: why is it so difficult to get a working IDE for Scala)?
- How do I change intellij idea to compile with scala 2.11?
- How to make IntelliJ IDEA use javac for Java and scalac for Scala?
- How to know if a Scala file modified with IntelliJ Idea is saved and if it is checked into CVS?
- How do I make intellij Idea to highlight Scala script correctly with #! (shebang)
- How to generate Scala setters and getters with IntelliJ IDEA
- How to get rid of downcast using synchronous send with Scala Actors?
- How to start with Scala, intelliJ IDEA and SBT?
- How to get rid of braces in boolean expressions with AND and OR
- How to work with Intellij Idea and Scala
- I Installed IntelliJ Idea with the Scala plugin. Why don't I have a scalac file anywhere?
- How to use SBT with Intellij Idea
- How do you modify block comment alignment in Intellij IDEA with Scala?
- How to build Android project with Scala sources in IntelliJ IDEA (Community Edition)?
- How to connect to Hive in Virtual Box from IntelliJ IDEA with Spark Scala
- How to create a Scala executable jar file that is built with Maven, and has log4j included, using IntelliJ IDEA IDE
- How do I get rid of my unchecked warning on implicit class with higher order function
- How to get IntelliJ IDEA to `activator publishLocal` as a task?
- How to get started with Akka Streams?
- How to create SBT project with IntelliJ Idea?
- How to force IntelliJ IDEA to reload dependencies from build.sbt after they changed?
- How to get the last date of a particular month with JodaTime?
- How to manage multiple interdependent modules with SBT and IntelliJ IDEA?
- How to get a list with the Typesafe config library
- How to use IntelliJ with Play Framework and Scala
- How to add Jar libraries to an IntelliJ Idea SBT Scala project?
More Query from same tag
- How to pass case class as a variable into ScalaReflection
- Akka Future Response to a Sender
- IntMap changes type after innocent mapping
- scala.None$.get(Option.scala:347) scala.None$.get(Option.scala:345)
- Solving type erasure problems with an abstract type in a trait
- What are the way/s of telling scala compiler that type TableQuery[T] can map to somthing has the attribute id
- Scala - Why can't a context bound case class be used as a default constructor parameter of another case class?
- new to scala & sbt - trying to compile a project that imports akka.stm._
- How to use string.split() without foreach()?
- Is it possible to pattern detect within a Window object?
- No Json serializer as JsObject found for type play.api.libs.json.JsObject
- How to override Scala generic methods for specific types?
- Spark Zepplin throws NPE on datasets
- scala deprecation warning with playframework and slick
- NullPointerException exception when using Flink's leftOuterJoinLateral in Scala
- eclipse(set with scala envirnment) : object apache is not a member of package org
- PlayFramework 2: Fetch data from h2 database, decimal types not map with Scala decimal type
- Is there any particular reason this type is not a generalized DFA? And if so, what is it really?
- Maven test coverage for scala
- SBT run with provided works under the '.' projects but fails with no mercy under any subprojects
- In Play 2.1, What to use instead of deprecated PushEnumerator
- Scala: reflect class with implicit param
- Could not find implicit when used in main method
- ZeroMQ, Does Scala Binding slow it down considerably
- GridGain / Scala - Generate Jobs within existing Job
- would it work to run scala with vaadin?
- Why is Ficus throwing an exception when I try to add a new field in my case class?
- Playframework POST parameter
- How reverse words in string and keep punctuation marks and upper case symbol
- Squeryl - "CustomTypesMode is not a member of package org.squeryl.customtypes"?