scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Add support for all kinds of JVM args via `.scala-jvmopts` file and `JAVA_OPTS` env var, not only java properties

Open nehaev opened this issue 10 months ago • 1 comments

Describe what needs to be done and why I'm trying to run a local Spark job as a shebang script. On modern JDKs, Spark requires certain args to be provided to JVM (e.g., --add-exports java.base/sun.nio.ch=ALL-UNNAMED). The current implementation of scala-cli can only propagate java properties (using JAVA_OPTS or .scala-jvmopts), but not other vm args. I receive the following warning:

Warning: Only java properties are supported in .scala-jvmopts file. Other options are ignored: --add-exports java.base/sun.nio.ch=ALL-UNNAMED

It's not the case for sbt, for example, as it supports such kind of args both in JAVA_OPTS and in .jvmopts file.

Describe alternatives you've considered I've considered scala-cli --power run --spark-standalone, it starts to download JDK 8, but it's not what I want.

It's not about running Spark at all costs, or inability to downgrade JVM. I believe scala-cli should be able to propagate all kinds of args to JVM.

nehaev avatar Apr 07 '24 23:04 nehaev