Setting system properties with “sbt run”

后端 未结 4 1989
灰色年华
灰色年华 2020-12-29 06:52

I\'m using a pretty recent version of SBT (seems to be hard to figure out what the version is). I want to pass system properties to my application with sbt run

4条回答
  •  孤城傲影
    2020-12-29 07:20

    I think the best is to use the JAVA_OPTS environment variable:

    #update the java options (maybe to keep previous options)
    export JAVA_OPTS="${JAVA_OPTS} -Dmyprop=x"
    #now run without any extra option
    sbt run
    

提交回复
热议问题