Various ways to run Scala code | Java Code Geeks
using Scala REPL
Read full article from Various ways to run Scala code | Java Code Geeks
using Scala REPL
It is basically command line interactive shell called as REPL short for Read-Eval-Print-Loop.
using Scala interpreter
scalac Hello.scalausing Java interpreter
As compiled Scala code is bytecode that we can run with Java interpreter which is java.exe or java.sh shipped with standard Java JRE distribution. But for this we need to put additional library in classpath.
We just need to add the scala-library.jar which located under $SCALA_HOME/lib
To run using java interpreter, we use following command
1 | shell > java - cp $SCALA_HOME/lib/scala-library.jar;. Hello |
No comments:
Post a Comment