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.



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.



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.


Please sign in to leave a comment.