How to read environment variables in Scala

前端 未结 6 615
渐次进展
渐次进展 2020-12-12 13:23

In Java, reading environment variables is done with System.getenv().

Is there a way to do this in Scala?

6条回答
  •  既然无缘
    2020-12-12 14:02

    To print all environment variables, you can use

    System.getenv.forEach((name, value) => println(s"$name: $value"))
    

提交回复
热议问题