I am new to JVM, so I apologize if this is a common problem. I am using Scala (2.12) with sbt 0.13.13 on OSX.
I am working on a tiny application that depends on the GUI library scala.swing(2.10.x). I ran into a runtime problem almost immediately with sample code ( http://otfried.org/scala/index_28.html ).
In particular, when sbt runI call, I get stacktrace leading from:
[error] (run-main-0) java.lang.NoClassDefFoundError: scala/Proxy$class
java.lang.NoClassDefFoundError: scala/Proxy$class
at scala.swing.Window.<init>(Window.scala:25)
at scala.swing.Frame.<init>(RichWindow.scala:75)
at scala.swing.MainFrame.<init>(MainFrame.scala:19)
( Proxyrepresented by class / trait in Scala stdlib)
Reading on SO and elsewhere suggests that such an exception is usually thrown when code present at compile time cannot subsequently be detected at runtime. Indeed, the code compiles just fine, only when you run the code there is a problem.
All the suggestions that I have found are your coordination classpathto solve these problems. However, according to the console sbt, my compile time and runtime paths are identical:
> show compile:fullClasspath
[info] * Attributed(/Users/chris/Projects/thing2/target/scala-2.12/classes)
[info] * Attributed(/Users/chris/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.1.jar)
[info] * Attributed(/Users/chris/.ivy2/cache/org.scala-lang/scala-swing/jars/scala-swing-2.10.6.jar)
[success] Total time: 0 s, completed Dec 24, 2016 7:01:15 PM
> show runtime:fullClasspath
[info] * Attributed(/Users/chris/Projects/thing2/target/scala-2.12/classes)
[info] * Attributed(/Users/chris/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.1.jar)
[info] * Attributed(/Users/chris/.ivy2/cache/org.scala-lang/scala-swing/jars/scala-swing-2.10.6.jar)
[success] Total time: 0 s, completed Dec 24, 2016 7:01:19 PM
So, I am in a purely judicial deadlock. Any suggestions on where to look for the next would be greatly appreciated. For clarity, this only happened with scala.swing. I have a few more small projects in Scala that didn't have any problems. What perplexity is the “missing” class seems to be Scala's standard lib material.