the idea project generated by sbt-idea can't compile when using with scala 2.10 because the new version of scala separate some class to a new jar file name scala-reflect.jar #175

Closed
sparkle opened this Issue Sep 3, 2012 · 3 comments

Projects

None yet

3 participants

@sparkle
sparkle commented Sep 3, 2012

Here's the exception:

Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/io/Streamable$Bytes at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
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:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at org.jetbrains.plugins.scala.compiler.rt.ClassRunner.main(ClassRunner.java:45)
Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.io.Streamable$Bytes
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:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 17 more

Quick fix:
Open Module Settings -> Libraries -> add scala-reflect.jar to the scala version that you use to compile

@jozic
Contributor
jozic commented Sep 3, 2012

Please try latest snapshot for sbt 0.12
Mikko added a fix for scala 2.10.x here b99b66d

@mpeltonen
Owner

Yeah, the latest snapshot might fix the issue so try that.

@sparkle
sparkle commented Sep 4, 2012

Oh I find it, thanks a lot.

@mpeltonen mpeltonen closed this Dec 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment