I am using IntelliJ IDEA 13.1.4 and also tried the latest release 14.
Running SBT I get the following error:
Error:Cannot determine Java VM executable in
The issue is usually caused by a wrong JDK version in ".idea/sbt.xml", e.g.:
<option name="jdk" value="1.7" />
This option is not updated accordingly when the Project SDK is changed, see SCL-10085. If you have the other JDK (1.7 in my example) generally configured, no error will occur, but the Project SDK will silently be changed back. Otherwise, this error occurs.
The problem can easily be resolved by manually editing the value in ".idea/sbt.xml" to the right JDK version.
I got the same problem after I delete Java1.6 and Java1.7 from Project Settings(with Java8 as default).
Finally I solve the problem by change SBT JVM config to Custom Java(Settings -> Build, Execution, Deployment -> Build Tools -> SBT).
For me, I had selected the JDK in "Open Module Settings" > Module > Dependencies > Module SDK. However, SBT was looking for JDK at project level which is set in "Open Module Settings" > Project > Project SDK as @michasm has pointed out above
Another way to set JDK is from your current module/project settings (for your current project)
PickOpen Module Settings
from project context menu (or default hit F4),
then from left tab select Project
and point correct Project SDK
on dropdown.
I had to open Settings -> Language & Frameworks -> Scala Compiler Server
Then set the JVM SDK there, which was <No SDK>
.
This was in addition to setting the Project SDK in Project Structure -> Project
.
See the screenshot here.