diff --git a/website/docs/commands/package.md b/website/docs/commands/package.md index 39b40cefe3..fd71751aa3 100644 --- a/website/docs/commands/package.md +++ b/website/docs/commands/package.md @@ -127,6 +127,25 @@ Hello Hello --> +By default assemblies are self-executable, just like the default package format. With the `--preamble=false` option, you can build an assembly that just contains the JAR and does not contain any built-in Bash code, and therefore can be launched directly with Java and is more portable: + + + +```bash +scala-cli --power package Hello.scala -o hello.jar --assembly --preamble=false +java -jar hello.jar +``` + +```text +Hello +``` + + + + + ## Docker container Scala CLI can create an executable application and package it into a docker image. @@ -506,4 +525,3 @@ The using directive allows you to define the image repository. ```scala compile power //> using packaging.dockerImageRepository scala-cli ``` -