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 -

Most of the .idea files are included in that repo, as well as all of the *.iml files.

Comment actions Permalink

Hi Cary,

It seems very strange indeed.
When you run or debug plugin all dependencies are located in the


Please check that directory. Maybe there is a corrupted jar file or different versions of a same library.

Comment actions Permalink

I started working on a different part in the meantime, but for what it's worth, here are the jars in that directory -

$ cd ~/.IntelliJIdea14/system/plugins-sandbox/plugins/intellij-haskforce
$ find . -name \*.jar

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 -

rm -rf ~/.IntelliJIdea14/system/plugins-sandbox/plugins/intellij-haskforce

Since then, those issues have gone away.  Not sure if it's related, but worth mentioning.

Comment actions Permalink

I've started work again on the Builder and am still facing the issue.  Might the jps-plugin be using a different classpath?

Comment actions Permalink

Ok, the problem was that I needed to include the jar in the plugin.xml file -

<compileServer.plugin classpath="jps/jps-plugin.jar;jps-shared.jar;scala-library-2.11.7.jar"/>

Once I did that, everything was golden.


Please sign in to leave a comment.