IntelliJ unable to compile my project


In most cases your project JDK is not compatible with Scala or sbt version, try to change the Scala Compile Server SDK.

  1. Press Ctrl+Alt+S to open Settings/Preferences dialog.
  2. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.
  3. In JVM SDK field specify the appropriate SDK.

Scala Compiler Options

We recommend that you switch to Java 8 SDK since the Scala version 2.12, and sbt versions 1.10 and later are not compatible with older Java SDK versions.

Script Shebang (linux)

Use this lines on the top of a .sh file.

exec scala "$0" "$@"

// Some scala code

and set the file as executable.

$ chmod +x

$ ./

(and it would run)