On replacing JavaConversions with JavaConverters
You need to add the asScala
method:
import scala.collection.JavaConverters._
for ((k,v) <- environmentVars.asScala) println(s"key: $k, value: $v")
Since Scala 2.13, this is now CollectionConverters
:
import scala.jdk.CollectionConverters._
for ((k,v) <- environmentVars.asScala) println(s"key: $k, value: $v")