compiler-explorer / compiler-explorer/compiler-explorer
[BUG]: Scala Main/App execution throws "java.lang.ClassNotFoundException: scala.Predef$"
- Dominant language
- TypeScript
- Stars
- 19.1k
- Forks
- 2.1k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 67
Description
### Describe the bug
Godbolt cannot run executable Scala programs, even those from [the official docs.scala-lang page](https://docs.scala-lang.org/scala3/book/taste-hello-world.html)
Instead `java.lang.ClassNotFoundException: scala.Predef$` is thrown, which (after some light searching) indicates an incorrect class path.
However, the scala examples indicate that it should be (or it is at least easier to) run with the `scala` command after compiling with the `scalac` command.
For example:
```
> cat hello.scala
object hello {
def main(args: Array[String]) = {
println("Hello, World!")
}
}%
> scalac hello.scala
> scala hello
Hello, World!
```
### Steps to reproduce
Example:
1. Start new Scala source view
2. Copy/paste the Scala 2 Hello World example from [the official docs.scala-lang page](https://docs.scala-lang.org/scala3/book/taste-hello-world.html)
3. add new "Execution Only"
4. Choose your favorite Scala 2 version (I've replicated this with 2.12.14, 2.13.6, and 3.0.0)
5. Observe the `java.lang.ClassNotFoundException: scala.Predef$` exception
### Expected behavior
The program should run and print "Hello, World!"
### Reproduction link
https://godbolt.org/z/fc8Tfh1oY
### Screenshots

### Operating System
_No response_
### Browser version
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.