This page is no longer maintained — Please continue to the home page at www.scala-lang.org

NoClassDefFoundError with scala.Console

No replies
Yo Eight 2
Joined: 2011-11-30,
User offline. Last seen 42 years 45 weeks ago.

Hi everyone !

I'm getting a NoClassDefFoundError when I call println as it's shown
in the snippet below:

object Hello extends App {
println("hello")
}

The odd thing is everything get build either by eclipse and sbt.

Here the stack trace:

[error] (run-main) java.lang.NoClassDefFoundError: Could not
initialize class scala.Console$
java.lang.NoClassDefFoundError: Could not initialize class
scala.Console$
at scala.Predef$.println(Predef.scala:192)
at filemanip.TTT$delayedInit$body.apply(Operation.scala:229)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV
$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:60)
at scala.App$$anonfun$main$1.apply(App.scala:60)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.TraversableForwarder
$class.foreach(TraversableForwarder.scala:30)
at scala.App$class.main(App.scala:60)
at filemanip.TTT$.main(Operation.scala:218)
at filemanip.TTT.main(Operation.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
at scala.Predef$.error(Predef.scala:66)

my setup:

scala 2.9.1.Final
sbt 0.11.2
Mac OSX 10.7
java 1.6.0_29

Regards

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland