title: type HomeController is not a member of package controllers - compilation error
body: <p>My Play Framework used to work until I rebuild the project. Then I get this error.</p>
  
  <p>My problem is exactly the one described in this <a href="https://stackoverflow.com/questions/40508995/type-is-not-a-member-of-package-controllers">post</a>.</p>
  
  <p>This is the top answer in another <a href="https://stackoverflow.com/questions/30543960/play-framework-for-scala-compilation-errortype-application-is-not-a-member-of">post</a>.</p>
  
  <blockquote>
    <p>Play 2.4, by default, generates a dependency injected router, unlike
    previously, when it used a static router. You have two options, remove
    the routesGenerator line from build.sbt so play will generate a static
    router, or (better) make your controllers classes instead of objects,
    and use dependency injection.</p>
  </blockquote>
  
  <p>This also didn't work for me. There is no routesGenerator line build.sbt. HomeController is already a class.</p>
  
  <p>build.sbt</p>
  
  <pre><code>name := """BookStoreApp"""
  
  version := "1.0-SNAPSHOT"
  
  lazy val root = (project in file(".")).enablePlugins(PlayJava)
  
  scalaVersion := "2.12.2"
  
  libraryDependencies += guice
  
  // Test Database
  libraryDependencies += "com.h2database" % "h2" % "1.4.194"
  
  // Testing libraries for dealing with CompletionStage...
  libraryDependencies += "org.assertj" % "assertj-core" % "3.6.2" % Test
  libraryDependencies += "org.awaitility" % "awaitility" % "2.0.0" % Test
  
  // Make verbose tests
  testOptions in Test := Seq(Tests.Argument(TestFrameworks.JUnit, "-a", "-v"))
  </code></pre>
  
  <p>home controller</p>
  
  <pre><code>package controllers;
  
  import play.mvc.*;
  import views.html.*;
  
  public class HomeController extends Controller {
      public Result startGame() {
          return ok(gameView.render());
      }
  
      public Result statsPage(){
          return ok(statsView.render());
      }
  
  }
  </code></pre>