Scala in jps-plugin
It seems that there are some issues with accessing the Scala standard libraries from a jps-plugin. For instance, when attempting to do something like `myString.nonEmpty`, I get -
Error: java.lang.NoClassDefFoundError: scala/collection/immutable/StringOps
The main plugin module works fine with the scala-sdk-2.11.7 global library, so I assumed it should work with the jps-plugin as well.
Note that things seem to work once the plugin is deployed; however, I cannot seem to get it to work when running/debugging the plugin.
Here's the exact code that causes the issue - https://github.com/carymrobbins/intellij-haskforce/blob/ae9fa3ad7c02aa1a04d640d8624bc7f3d972569e/jps-plugin/src/com/haskforce/jps/stack/StackBuilder.scala#L35-L36
Most of the .idea files are included in that repo, as well as all of the *.iml files.
Please sign in to leave a comment.
Hi Cary,
It seems very strange indeed.
When you run or debug plugin all dependencies are located in the
<system_dir>/plugins-sandbox/plugins/intellij-haskforce/lib
Please check that directory. Maybe there is a corrupted jar file or different versions of a same library.
I started working on a different part in the meantime, but for what it's worth, here are the jars in that directory -
Side note - I have had issues with the plugin run configurations giving me NoClassDefFound errors and have gotten around it by adding a script to run before the Make portion of the run config -
Since then, those issues have gone away. Not sure if it's related, but worth mentioning.
I've started work again on the Builder and am still facing the issue. Might the jps-plugin be using a different classpath?
Ok, the problem was that I needed to include the jar in the plugin.xml file -