Files
cheatsheet-tldr/tldr/scala
2025-11-27 00:20:32 +00:00

30 lines
624 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# 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 in the command-line:
`scala {{[-e|--execute-script]}} {{command}}`