Not able to run Scala classes using SBT

I am not able to run my Scala projects in (especially) the Scala Worksheet. Trying to run a program gives this error message:

Internal error: Scala instance doesn't exist or is invalid:
version unknown, library jar: C:\Users\magnu\.ivy2\cache\jline\jline\jars\jline-2.14.5.jar, compiler jar: C:\Users\magnu\.ivy2\cache\org.scala-lang.modules\scala-xml_2.12\bundles\scala-xml_2.12-1.0.6.jar
org.jetbrains.jps.incremental.scala.remote.ClientEventProcessor.process(ClientEventProcessor.scala:22)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$class.handle(RemoteResourceOwner.scala:47)
org.jetbrains.plugins.scala.compiler.RemoteServerRunner.handle(RemoteServerRunner.scala:14)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$$anonfun$send$1$$anonfun$apply$1$$anonfun$apply$3.apply(RemoteResourceOwner.scala:30)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$$anonfun$send$1$$anonfun$apply$1$$anonfun$apply$3.apply(RemoteResourceOwner.scala:29)
org.jetbrains.jps.incremental.scala.package$.using(package.scala:21)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$$anonfun$send$1$$anonfun$apply$1.apply(RemoteResourceOwner.scala:29)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$$anonfun$send$1$$anonfun$apply$1.apply(RemoteResourceOwner.scala:25)
org.jetbrains.jps.incremental.scala.package$.using(package.scala:21)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$$anonfun$send$1.apply(RemoteResourceOwner.scala:25)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$$anonfun$send$1.apply(RemoteResourceOwner.scala:24)
org.jetbrains.jps.incremental.scala.package$.using(package.scala:21)
org.jetbrains.jps.incremental.scala.remote.RemoteResourceOwner$class.send(RemoteResourceOwner.scala:24)
org.jetbrains.plugins.scala.compiler.RemoteServerRunner.send(RemoteServerRunner.scala:14)
org.jetbrains.plugins.scala.compiler.RemoteServerRunner$$anon$1$$anonfun$run$1.apply$mcVI$sp(RemoteServerRunner.scala:33)
scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160)
org.jetbrains.plugins.scala.compiler.RemoteServerRunner$$anon$1.run(RemoteServerRunner.scala:30)
org.jetbrains.plugins.scala.worksheet.server.RemoteServerConnector.compileAndRun(RemoteServerConnector.scala:107)
org.jetbrains.plugins.scala.worksheet.processor.WorksheetCompiler$$anon$3.run(WorksheetCompiler.scala:69)
com.intellij.compiler.progress.CompilerTask.run(CompilerTask.java:197)
com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:718)
com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:170)
com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:548)
com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:330)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)

I have tried to figure out what's wrong, but have not been able to. The only time i actually succeeded was when I uninstalled Scala plugin and deleted SBT from the computer, and reinstalled them. However, when I try to create new projects the problem is still there.

If I right click on a class to try to run it, I will not be able to click on "Run: <class name>" since it's not there.

I have checked my sources root, and that should not be the problem.

Version of Scala: 2.12.4 (and/or 3)
Version of SBT: 1.0.2

2 comments
Comment actions Permalink

I think you might be running into the sbt problem described in https://youtrack.jetbrains.com/issue/SCL-12736

Does it not work if you set the scala version to 2.12.3 and reload? Or if you downgrade to sbt 0.13.16?

 

0
Comment actions Permalink

It worked when downgrading to SBT 0.13.16. Not tried changing the scala version

0

Please sign in to leave a comment.