title: Error occurs while calling Scala code in Java in Eclipse
body: <p>I would like to call the following Scala code in Java:</p>
  
  <p><strong>Scala code</strong></p>
  
  <pre><code>package calculate
  
  import java.io._
  
  class CalculationScala
  
  object CalculationScala {
    def main(args: Array[String]) {
      def operate(a: Double, b: Double, op: (Double, Double) =&gt; Double): Double = (op(a, b))
      println(operate(5, 15, _-_))
    }
  }
  </code></pre>
  
  <p><strong>Java code</strong></p>
  
  <pre><code>package calculate;
  
  public class Calculation {
      public static void main(String[] args) {
          CalculationScala calculationScala = new CalculationScala();
          calculationScala.main(args);
      }
  }
  </code></pre>
  
  <p>but the following error occurs.</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: scala/Function2
      at calculate.CalculationScala.main(CalculationScala.scala)
      at calculate.Calculation.main(Calculation.java:79)
  Caused by: java.lang.ClassNotFoundException: scala.Function2
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      ... 2 more
  </code></pre>
  
  <p>How to solve this issue?</p>