Skip to content

Commit 26993db

Browse files
authored
Merge pull request #3699 from VirtusLab/stable
Back port of documentation changes to main
2 parents 8049991 + b788372 commit 26993db

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

website/docs/cookbooks/introduction/scala-jvm.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ object Main extends App {
2323
To use Java 11 to run this application, pass the following `--jvm` option to the Scala CLI command:
2424

2525
```bash ignore
26-
scala-cli --jvm adopt:11 Main.scala
26+
scala-cli --jvm temurin:11 Main.scala
2727
```
2828

2929
<!-- ignored Expected:
@@ -33,12 +33,16 @@ Hello from ScalaCli
3333
To attempt to compile the application with Java 8, change the value of the `--jvm` parameter:
3434
```bash ignore fail
3535
scala-cli --jvm 8 Main.scala
36-
# In this case, it raises an error because the `Files.createTempFile` method is not available in java 8
36+
# In this case, it raises an error because the `Files.writeString` and `Files.readString` methods are not available in java 8
3737
#
38-
# Exception in thread main: java.lang.Exception: java.lang.NoSuchMethodError: java.nio.file.Files.writeString(Ljava/nio/file/Path;Ljava/lang/CharSequence;[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;
39-
# at method print in modules/runner/src/main/scala-3-stable/scala/cli/runner/Stacktrace.scala:12 inside runner_3.jar
40-
# at method printException in modules/runner/src/main/scala/scala/cli/runner/StackTracePrinter.scala:91 inside runner_3.jar
41-
# at method main in modules/runner/src/main/scala/scala/cli/runner/Runner.scala:22 inside runner_3.jar
38+
# [error] ./Main.scala:6:18
39+
# [error] value writeString is not a member of object java.nio.file.Files
40+
# [error] val filePath = Files.writeString(dest, "Hello from ScalaCli")
41+
# [error] ^^^^^^^^^^^^^^^^^
42+
# [error] ./Main.scala:7:29
43+
# [error] value readString is not a member of object java.nio.file.Files
44+
# [error] val fileContent: String = Files.readString(filePath)
45+
# [error] ^^^^^^^^^^^^^^^^
4246
```
4347

4448
<!-- ignored Expected:

0 commit comments

Comments
 (0)