scalap.jar incompatibility with 2.8.0 when building Scala plugin

I just came across what looks like a bug in the Scala plugin build.xml.
I was getting this error when building the plugin on a new machine:

   [scalac] C:\Users\chilang\code\scala-plugin\src\org\jetbrains\plugins\scala\decompiler\DecompilerUtil.scala:134: error: type mismatch;
   [scalac]  found   : (with underlying type object
   [scalac]  required: Boolean
   [scalac]       val printer = new ScalaSigPrinter(stream, HideInstancePrivate)
   [scalac]                                                 ^
   [scalac] one error found

I was a bit baffled as I was getting the build fine with pretty much the same config/sources.
It turned out that Scala plugin is using a different version of scalap.jar (bundled with its sources under \SDK\scalap\scalap.jar) instead of the jar coming from scala distribution (specified via, I was using
The build.xml is a bit naughty as it is copying its version of scalap.jar into scala distribution lib folder unless it sees a newer version, i.e.:

     [copy] scalap.jar omitted as c:\apps\\lib\scalap.jar is up to date.

The results is that both version scalap.jar ends up in the build classpath and in certain path combination (when you scala distribution scalap.jar path ended up before the bundled scalap.jar), the build will fail as above.

Attached is a patch to build.xml which fix this problem by excluding scalap.jar from scala distribution and explicitly including the bundled one.

Hope this helps,
Chi Lang

1 comment

Thank you for patch, of course it's better then move scalap from one folder to another.

Best regards,
Alexander Podkhalyuzin.


Please sign in to leave a comment.