title: SBT error: java.lang.RuntimeException: No main class detected
body: <p>Update:<br>
  I need put libraryDependencies for using Actor in Scala.</p>
  
  <pre><code>libraryDependencies &lt;++= scalaVersion(v =&gt;
    Seq("org.scala-lang" % "scala-actors" % v)
  )
  </code></pre>
  
  <hr>
  
  <p>when I ran "sbt run", I could successfully pass the compilation but then failed on run the code.</p>
  
  <p>Here is the error:
   java.lang.RuntimeException: No main class detected.</p>
  
  <p>The weird thing is when I do not use SBT, I can run it without any issue:</p>
  
  <pre><code>&gt;scalac actor.scala
  &gt;scala pingpong
  </code></pre>
  
  <p>Any idea why this happens?</p>
  
  <p>I am using SBT 0.13.0
  Scala version is 2.10.2</p>
  
  <p>Thanks</p>
  
  <h2>Deryk.</h2>
  
  <p>Here is my code:</p>
  
  <pre><code>import scala.actors.Actor
  import scala.actors.Actor._
  
  case object Ping;
  case object Pong;
  case object Stop;
  
  class Ping(count:Int, pong:Actor) extends Actor
  {
      def act()
      {
          var counter = count -1 ;
          pong ! Ping;
          loop
          {
              react
              {
                  case Pong =&gt;
                  if( (counter &lt; count) &amp;&amp; (counter &gt; 0) ) {Console.println(counter+"-&gt;Ping: pong"); pong ! Ping; counter = counter -1;} 
                  else {pong ! Stop;exit()}
  
              }
          }
      }
  }
  
  class Pong extends Actor
  {
      def act()
      {
          loop
          {
              react
              {
                 case Ping =&gt; {Console.println("Pong: Ping"); sender ! Pong;}
                 case Stop =&gt; {Console.println("Ping Pong Communication is done!");exit()}
              }
          }
      }
  }
  
  object pingpong
  {
      def main(args: Array[String])
      {
          println(util.Properties.versionString)
          val pong = new Pong
  
          val ping = new Ping(5, pong)
  
          ping.start
          pong.start
      }
  }
  </code></pre>