title: Gradle fails when executes run task for scala
body: <p>I created a <code>HelloWorld</code> app and I was able to execute <em>build</em> task but fail to execute <em>run</em> task.
  I got the following error: </p>
  
  <blockquote>
    <p>Could not find or load main class Demo</p>
  </blockquote>
  
  <p>The following is my build.gradle file:</p>
  
  <pre><code>apply plugin: 'scala'
  repositories{
      mavenCentral()
      mavenLocal()
  }
  dependencies{
      compile 'org.slf4j:slf4j-api:1.7.5'
      compile "org.scala-lang:scala-library:2.11.2"
      testCompile "junit:junit:4.11"
  }
  task run(type: JavaExec, dependsOn: classes) {
      main = 'Demo'
  }
  </code></pre>
  
  <p>My source code <em>Demo.scala</em>:</p>
  
  <pre><code>object Demo {
     def main(args: Array[String]) {
          println("Helo World")
     }
  }
  </code></pre>
  
  <p>My file structure:</p>
  
  <pre><code>build
  src\main\scala\Demo.scala
  build.gradle
  </code></pre>
  
  <p>I am using gradle 3.0 and Java 1.8.0_91.
  It looks to me that I am missing some settings related to <em>classpath</em>.
  Any help will be appreciated.</p>