SBT 0.13.9 fail: java.lang.ClassNotFoundException: org.jetbrains.sbt.ReadProject$

I recently had to fix Homebrew so I uninstalled and reinstalled it, and all the packages with it.  In the process I went from sbt 0.13.8 to 0.13.9.

Now many of my projects won't build unless I add a file root/project/build.properties the line "sbt.version=0.13.8" to force it to use the sbt 13.8 launcher.

NOTE:  I use custom SBT Launcher in my settings with a path = "/usr/local/Cellar/sbt/0.13.9/libexec/sbt-launch.jar" becuase the Intellij bundled SBT launcher complains about missing line breaks that are valid according to the system SBT launcher.

NOTE: I can run sbt assembly or sbt compile from the command line on this project without above mentioned root/project/build.properties and it totally works, so somehow Intellij is still getting in the middle of the custom sbt launcher I specified.

Is sbt 0.13.9 known to have Intellij compatibility issues?

Here's the error I get if I don't force sbt.version=0.13.8:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0

[info] Loading global plugins from /Users/abohr/.sbt/0.13/plugins

[info] Loading project definition from /Users/me/git/my-spark-project/

[info] Set current project to my-spark-project (in build file:/Users/me/git/my-spark-project/)

> [info] Defining *:shellPrompt

[info] The new value will be used by no settings or tasks.

[info] Reapplying settings...

[info] Set current project to scala-spark-beacon-join (in build file:/Users/me/git/my-spark-project/)

[info] Defining *:artifactPath

[info] The new value will be used by no settings or tasks.

[info] Reapplying settings...

[info] Set current project to scala-spark-beacon-join (in build file:/Users/me/git/my-spark-project)

[info] Defining *:artifactClassifier

[info] The new value will be used by compile:packageBin::artifact, compile:packageDoc::artifact and 3 others.

[info]  Run `last` for details.

[info] Reapplying settings...

[info] Set current project to scala-spark-beacon-join (in build file:/Users/abohr/git/scala-spark-beacon-join/)

[info] Applying State transformations org.jetbrains.sbt.ReadProject from /Users/me/Library/Application Support/IntelliJIdea14/Scala/launcher/sbt-structure-1.0.jar

java.lang.ClassNotFoundException: org.jetbrains.sbt.ReadProject$

 at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

 at java.lang.Class.forName0(Native Method)

 at java.lang.Class.forName(Class.java:348)

 at sbt.ModuleUtilities$.getObject(ModuleUtilities.scala:14)

 at sbt.BasicCommands$$anonfun$call$2$$anonfun$6.apply(BasicCommands.scala:130)

 at sbt.BasicCommands$$anonfun$call$2$$anonfun$6.apply(BasicCommands.scala:130)

 at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)

 at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)

 at scala.collection.immutable.List.foreach(List.scala:318)

 at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)

 at scala.collection.AbstractTraversable.map(Traversable.scala:105)

 at sbt.BasicCommands$$anonfun$call$2.apply(BasicCommands.scala:130)

 at sbt.BasicCommands$$anonfun$call$2.apply(BasicCommands.scala:125)

 at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)

 at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)

 at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)

 at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)

 at sbt.Command$.process(Command.scala:93)

 at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)

 at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)

 at sbt.State$$anon$1.process(State.scala:184)

 at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)

 at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)

 at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)

 at sbt.MainLoop$.next(MainLoop.scala:98)

 at sbt.MainLoop$.run(MainLoop.scala:91)

 at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)

 at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)

 at sbt.Using.apply(Using.scala:24)

 at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)

 at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)

 at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)

 at sbt.MainLoop$.runLogged(MainLoop.scala:24)

 at sbt.StandardMain$.runManaged(Main.scala:53)

 at sbt.xMain.run(Main.scala:28)

 at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)

 at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)

 at xsbt.boot.Launch$.run(Launch.scala:109)

 at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)

 at xsbt.boot.Launch$.launch(Launch.scala:117)

 at xsbt.boot.Launch$.apply(Launch.scala:18)

 at xsbt.boot.Boot$.runImpl(Boot.scala:41)

 at xsbt.boot.Boot$.main(Boot.scala:17)

 at xsbt.boot.Boot.main(Boot.scala)

[error] java.lang.ClassNotFoundException: org.jetbrains.sbt.ReadProject$

[error] Use 'last' for the full log.

Thanks

6 comments
Comment actions Permalink

Hi! Thanks for noticing. This issue was fixed in the latest release (1.8.4) and EAP (1.8.196.1) for IDEA 15. Please consider updating your IDEA and plugin.

BTW, you don't need to use sbt-launch.jar from 0.13.9 to build your projects using SBT 0.13.9. You could either put `sbt.version=0.13.9` to `project/build.properties` file OR put `-Dsbt.version=0.13.9` flag to `VM parameters` in SBT settings in IDEA.

0
Comment actions Permalink

Thanks for the response Nikolay.

So I'm using IDEA 14.1.4 Ultimate, I ran "Check for Updates" and it says I'm using the most current.  I don't use the EAP releases as I prefer stability and fewer bugs over having the newest features.  So is this issue only fixed in Intellij 15 ?  That means the license I bought for version 14 won't include a fix for this bug and I would need to use version 15 when it's released later this year (outside of EAP)?

Also I tried using sbt.version=0.13.8 (and sbt.version=0.13.9) in the SBT JVM options instead of using the project/build.properties file but that still didn't work.  Same error.

it seems the only fix is to use a project/build.properties file with the line sbt.version=0.13.8.

That fix works so this isn't a very big issue, but I'm more confused why this behavior is taking place.  If I'm using a custom SBT launcher, which runs fine from the command line outside of Intellij, I don't know why it can't run OK inside of Intellij.  I thought by specifying a custom SBT launcher instead of using the Intellij bundled one I can expect identical behavior from SBT inside and outside of Intellij.

0
Comment actions Permalink

Yes, this issue is fixed for IDEA 15 so far. I'm not aware about upcoming fix-releases of Scala plugin for IDEA 14, so, I guess, you need to update both IDEA and Scala plugin if you want to use sbt-launch.jar from SBT 0.13.9.

Also I tried using sbt.version=0.13.8 (and sbt.version=0.13.9) in the SBT JVM options instead of using the project/build.properties file but that still didn't work.  Same error.


That's probably because you still use custom 0.13.9 launcher. The purpose of setting SBT version in JVM options is to use the latest version of SBT with bundled launcher. It should help you with the "line breaks" problem.

So, please do the following:

  1. Swtich Launcher to Bundled
  2. Add "-Dsbt.version=0.13.9" to VM parameters.


And then try to import project.

0
Comment actions Permalink

Thanks - that worked. Now I'm back to using bundled launcher and no more issues with the build files.

0
Comment actions Permalink

Great to hear that!

0
Comment actions Permalink

Problem seems to return with recent sbt 1.2.8 and mostly recent (14.1.5) IntelliJ community edition

0

Please sign in to leave a comment.