HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

scala — Scala application launcher and interactive interpreter. More information: <https://scala-cli.virtusl

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandlauncherandscalacliinteractiveapplication

Problem

How to use the scala command: Scala application launcher and interactive interpreter. More information: <https://scala-cli.virtuslab.org/docs/reference/cli-options/>.

Solution

scala — Scala application launcher and interactive interpreter. More information: <https://scala-cli.virtuslab.org/docs/reference/cli-options/>.

Start a REPL (interactive shell):
scala


Start the interpreter with a dependency in the [c]lass[p]ath:
scala {{[-cp|--extra-jars]}} {{filename.jar}} {{command}}


Execute a Scala script:
scala {{script.scala}}


Execute a .jar program:
scala {{filename.jar}}


Execute a single Scala command:
scala {{[-e|--execute-script]}} {{command}}

Code Snippets

Start a REPL (interactive shell)

scala

Start the interpreter with a dependency in the [c]lass[p]ath

scala {{[-cp|--extra-jars]}} {{filename.jar}} {{command}}

Execute a Scala script

scala {{script.scala}}

Execute a `.jar` program

scala {{filename.jar}}

Execute a single Scala command

scala {{[-e|--execute-script]}} {{command}}

Context

tldr-pages: common/scala

Revisions (0)

No revisions yet.