Executing sbt run in current project with ensime emacs : <p>I have a Scala project called <code>scala-playground</code> and I generated the configuration for Ensime with <code>sbt ensimeConfig</code> and <code>sbt ensimeConfigProject</code>.</p>

<p>When running <code>M-x ensime</code> from a buffer of the project, I can see in the Emacs statusbar that Ensime is connected: it displays <code>Scala[scala-playground]</code>.</p>

<p>When running the project with <code>C-c C-b r</code>, a new sbt instance is started in the home directory, a directory in <code>$HOME/project</code> is created and instead of the project directory and fails:</p>

<pre><code>[info] Loading project definition from /home/user/project
[info] Set current project to user (in build file:/home/user/)
[info] sbt server started at 127.0.0.1:4766
sbt:user&gt; 
sbt:user&gt; run
[error] java.lang.RuntimeException: No main class detected.
[error]     at scala.sys.package$.error(package.scala:27)
[error]     at sbt.Defaults$.$anonfun$runTask$4(Defaults.scala:1199)
[error]     at scala.Option.getOrElse(Option.scala:121)
[error]     at sbt.Defaults$.$anonfun$runTask$3(Defaults.scala:1199)
[error]     at sbt.Defaults$.$anonfun$runTask$3$adapted(Defaults.scala:1198)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:64)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
[error]     at sbt.Execute.work(Execute.scala:266)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (compile:run) No main class detected.
[error] Total time: 0 s, completed Aug 28, 2017 9:10:03 PM
</code></pre>

<p>What is going on?</p>
