User defined JVM arguments on the command line
susliko opened this issue · 2 comments
susliko commented
Is it possible to provide custom VM startup options of the scala_binary
targets while running bazel run
from the command line?
--jvmopt
(https://docs.bazel.build/versions/master/command-line-reference.html#flag--jvmopt)
seems not to be working in the following run:
bazel run --jvmopt="-Dfoo=bar" //:app
JaredNeil commented
That --jvmopt
flag is for passing options to the bazel server on startup.
If you want to pass arguments to your bazel run
process, you put them after a --
.
The scala_binary
rule uses this wrapper script to launch .jar
s. It takes a --jvm_flag
option that will forward to the java command.
So this is what you want:
bazel run //:app -- --jvm_flag="-Dfoo=bar"
susliko commented
It worked. Thank you!