Can java run a compiled scala code?

Tags: ,



Can command java run a compiled scala code? If so, why do we have an exclusive command scala?

Answer

You can run byte code generated by Scala if you include all necessary runtime libs for Scala (scala-library.jar, scala-swing.jar …) in the classpath. The scala command does this automatically, and supports Scala specific command line arguments.



Source: stackoverflow