Compile/runtime random classnotfound issues on a scala3 project

已完成

I am having this issue for a few months now. I have a scala3 project, sbt, BSP, jdk21.0.1 on latest MacOS. Nothing unusual, only thing is that sbt adds an extra source folder in some modules, the IDE sees those fine.

But when I compile randomly I get compilation errors with a class missing. As soon as the compilation error happens, the IDE figures out the class is there and if I recompile it compiles fine.

Now I get the same issue when running code. I run the code, runtime classnotfound exception. I checked both the classpath and the location where the class should be and it is all there and fine. If I rerun (without changing anything) it runs fine (sometimes I get a 2nd classnotfound exception for an other class but if I rerun it works)

Nothing like that ever happened when I run things with sbt. And as said, always the class files or source files are always there.

 

2

Today it went as far as 

Error: Could not find or load main class xsbt.boot.Boot
Caused by: java.lang.ClassNotFoundException: xsbt.boot.Boot

 

when trying to compile. When I tried recompiling, it worked ok.

 

0

bump. Should I open a bug request? This happens all the time and it is very annoying. Can't be the only one facing this.

1

Sorry for the late reply. 
If you still experience the issue, please report it via our YouTrack 
https://youtrack.jetbrains.com/newIssue?project=SCL

0

Hi, the issue was fixed on the latest intellij,thanks

0

It look like an IDE/BSP sync issue rather than Scala itself. Since sbt works consistently, try rebuilding via sbt, invalidate IDE caches, and reimport the project. Also check that generated source folders are correctly marked. Sharing your IDE, Scala plugin, and BSP versions would help narrow it down.

0

sometime in the couple last years this was resolved, not sure when or how but I don't get the issue anymore

0

请先登录再写评论。