Error compiling scala

I'm using IDEA 9.0.1, Scala plug-in version 0.3.473, Scala 2.7.5 (using
Lift). I tried to compile a Scala source file from Ant and got a bunch
of errors (see below).

Information:Compilation completed with 16 errors and 0 warnings
Information:16 errors
Information:0 warnings
Error:Scalac internal error: class
java.lang.reflect.InvocationTargetException
[sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39),
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25),
java.lang.reflect.Method.invoke(Method.java:597),
org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)][scala.tools.nsc.Main.main(Main.scala),
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39),
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25),
java.lang.reflect.Method.invoke(Method.java:597),
org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)]
Error:sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Error:sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Error:java.lang.reflect.Method.invoke(Method.java:597)
Error:org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)
Error:Caused by java.lang.NoClassDefFoundError: scala/runtime/BoxedArray
Error:scala.tools.nsc.Main.main(Main.scala)
Error:Caused by java.lang.ClassNotFoundException: scala.runtime.BoxedArray
Error:java.net.URLClassLoader$1.run(URLClassLoader.java:200)
Error:java.security.AccessController.doPrivileged(Native Method)
Error:java.net.URLClassLoader.findClass(URLClassLoader.java:188)
Error:java.lang.ClassLoader.loadClass(ClassLoader.java:315)
Error:sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
Error:java.lang.ClassLoader.loadClass(ClassLoader.java:250)
Error:java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

5 comments
Comment actions Permalink

Correction - this is the error that I get trying to compile the file in
the IDE. Also, I tried build 484 and it was no help.

Donald

Donald Mclean wrote:

I'm using IDEA 9.0.1, Scala plug-in version 0.3.473, Scala 2.7.5 (using
Lift). I tried to compile a Scala source file from Ant and got a bunch
of errors (see below).

Information:Compilation completed with 16 errors and 0 warnings
Information:16 errors
Information:0 warnings
Error:Scalac internal error: class
java.lang.reflect.InvocationTargetException
[sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39),
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25),
java.lang.reflect.Method.invoke(Method.java:597),
org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)][scala.tools.nsc.Main.main(Main.scala),
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method),
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39),
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25),
java.lang.reflect.Method.invoke(Method.java:597),
org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)]

Error:sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

Error:sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Error:java.lang.reflect.Method.invoke(Method.java:597)
Error:org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:74)

Error:Caused by java.lang.NoClassDefFoundError: scala/runtime/BoxedArray
Error:scala.tools.nsc.Main.main(Main.scala)
Error:Caused by java.lang.ClassNotFoundException: scala.runtime.BoxedArray
Error:java.net.URLClassLoader$1.run(URLClassLoader.java:200)
Error:java.security.AccessController.doPrivileged(Native Method)
Error:java.net.URLClassLoader.findClass(URLClassLoader.java:188)
Error:java.lang.ClassLoader.loadClass(ClassLoader.java:315)
Error:sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
Error:java.lang.ClassLoader.loadClass(ClassLoader.java:250)
Error:java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)

0
Comment actions Permalink

Do you have the check-boxes "Use Sala compiler libraries form specified jars" and / or "Use additional jars for compiler or SDK" selected in the Scala facet for your project? If so, de-select them.


Randall Schulz

0
Comment actions Permalink

Randall Schulz wrote:

Do you have the check-boxes "Use Sala compiler libraries form specified jars" and / or "Use additional jars for compiler or SDK" selected in the Scala facet for your project? If so, de-select them.


Thank you, Randal - your suggestion was a big help.

The problem wasn't using "Use Scala compiler libraries from specified
jars" (which was checked) but that the two jars were from different
versions of Scala and neither was for 2.7.5

0
Comment actions Permalink

This is not native logic for setting up scala compiler. It's possibly will be changed. Sorry for inconveniences.

Best regrads,
Alexander Podkhalyuzin.

0
Comment actions Permalink

I ran into this issue using maven specifying scala 2.8.rc7. I generated the idea project file using mvn idea:idea and when i opened the idea project file, the  "create scala facet" popped up. I think the create scala facet defaults the scala-compiler from the intellij scala plugin directory and the scala-library from the maven directory.

0

Please sign in to leave a comment.