The man page for scala
says it should be able to run either a "A top-level object or a script file," but I can't get the latter to work.
# This works:
scalac Example.scala && scala Example
# ...but this doesn't:
scala Example.scala
The error message is always
error: Compile server encountered fatal condition: javax/tools/DiagnosticListener java.lang.ClassNotFoundException: javax.tools.DiagnosticListener
...but the code is simply:
object Exmple {
def main(args: Array[String]): Unit = {
System.out.println("Example")
}
}