2025-03-14 21:59:59 -06:00
|
|
|
# scala
|
|
|
|
|
|
|
|
|
|
> Scala application launcher and interactive interpreter.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://scala-cli.virtuslab.org/docs/reference/cli-options>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Start a REPL (interactive shell):
|
|
|
|
|
|
|
|
|
|
`scala`
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Start the interpreter with a dependency in the [c]lass[p]ath:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`scala {{[-cp|--extra-jars]}} {{filename.jar}} {{command}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Execute a Scala script:
|
|
|
|
|
|
|
|
|
|
`scala {{script.scala}}`
|
|
|
|
|
|
|
|
|
|
- Execute a `.jar` program:
|
|
|
|
|
|
|
|
|
|
`scala {{filename.jar}}`
|
|
|
|
|
|
|
|
|
|
- Execute a single Scala command in the command-line:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`scala {{[-e|--execute-script]}} {{command}}`
|