How do I set a system property for my project in sbt?

后端 未结 3 2081
长发绾君心
长发绾君心 2021-02-14 06:35

I\'m sure I\'m missing something really simple... I want to set the system property java.awt.headless to true for my sbt project. Reading the page on p

3条回答
  •  梦谈多话
    2021-02-14 06:51

    If I needed this option for all sbt tasks, I'd set it as follows in build.sbt

    javaOptions += "-Djava.awt.headless=true" 
    

    If it was just for one task, eg: run, you can scope that:

    javaOptions in Runtime += "-Djava.awt.headless=true" 
    

提交回复
热议问题