Linux command
cs-launch 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Launch an application
cs launch [org.scalameta::metals:latest.stable]
Launch with arguments
cs launch [com.lihaoyi::ammonite:2.5.9] -- [--help]
Launch with a specific main
cs launch [org.example::app:1.0] -M [com.example.Main]
Launch from custom repository
cs launch -r [https://repo.example.com/maven] [org.example::app:1.0]
Launch with extra JVM
cs launch [app:version] --java-opt [-Xmx2G]
Launch and fork
cs launch --fork [app:version]
说明
cs launch runs JVM applications directly from their Maven coordinates without prior installation. It resolves dependencies, downloads artifacts, and executes the application in a single command. This enables trying applications without installing them, running specific versions for testing, or scripting application execution. Dependencies are cached, so subsequent launches of the same version are fast. The command supports both Scala (using :: for cross-versioning) and Java artifacts. It can launch any artifact with a main class defined in its manifest or explicitly specified.
参数
- -M _CLASS_, --main-class _CLASS_
- Specify the main class to run.
- -r _URL_, --repository _URL_
- Add a custom Maven repository.
- --java-opt _OPT_
- JVM options passed to the launched application.
- --fork
- Fork the process and return immediately.
- --standalone
- Include all dependencies in classpath.
- --
- Separator between cs options and application arguments.
- -q, --quiet
- Suppress coursier output.
FAQ
What is the cs-launch command used for?
cs launch runs JVM applications directly from their Maven coordinates without prior installation. It resolves dependencies, downloads artifacts, and executes the application in a single command. This enables trying applications without installing them, running specific versions for testing, or scripting application execution. Dependencies are cached, so subsequent launches of the same version are fast. The command supports both Scala (using :: for cross-versioning) and Java artifacts. It can launch any artifact with a main class defined in its manifest or explicitly specified.
How do I run a basic cs-launch example?
Run `cs launch [org.scalameta::metals:latest.stable]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -M _CLASS_, --main-class _CLASS_ do in cs-launch?
Specify the main class to run.