title: Scala-IDE: How to compile and execute multiple source code files in Eclipse?
body: <p>I am reading Martin Odersky's <em>Programming in Scala</em>, and I have been using vi and the command line to compile so far.  I want to learn to use Eclipse and the Scala-IDE plug-in, but I lack a basic understanding of compiling and executing multiple source code files in Eclipse.</p>
  
  <p>My IDE is as follows:</p>
  
  <ul>
  <li>Ubuntu 12.04</li>
  <li>Eclipse 3.7.2</li>
  <li>Scala Plugin 2.0.1</li>
  <li>Scala Library 2.9.2</li>
  </ul>
  
  <p>I am using the Checksum example in Chapter 4 for practice.  The source code is as follows:</p>
  
  <p><strong>Listings 4.1 &amp; 4.2 / ChecksumAccumulator.scala</strong>:</p>
  
  <pre><code>class ChecksumAccumulator {
      private var sum = 0
      def add(b: Byte) { sum += b }
      def checksum(): Int = ~(sum &amp; 0xFF) + 1
  }
  
  import scala.collection.mutable.Map
  
  object ChecksumAccumulator {
  
      private val cache = Map[String, Int]()
  
      def calculate(s: String): Int = 
          if (cache.contains(s))
              cache(s)
          else {
              val acc = new ChecksumAccumulator
              for (c &lt;- s)
                  acc.add(c.toByte)
              val cs = acc.checksum()
              cache += (s -&gt; cs)
              cs
          }
  }  
  </code></pre>
  
  <p><strong>Listing 4.3 / Summer.scala:</strong></p>
  
  <pre><code>import ChecksumAccumulator.calculate
  
  object Summer {
      def main(args: Array[String]) {
          for (arg &lt;- args)
              println(arg + ": " + calculate(arg))
      }
  }
  </code></pre>
  
  <p>I can compile these classes using <code>scalac Summer.scala ChecksumAccumulator.scala</code> at the command line.  I can then execute the object code with the command line <code>scala Summer of love</code>, which returns the checksum results for "of" and "love" (-213 and -182, respectively).</p>
  
  <p>How would I build the object code using Eclipse and not the command line, and how would I call the <code>Summer</code> object code through Eclipse?</p>