Passing an entire file to JVM arguments

后端 未结 4 636
别跟我提以往
别跟我提以往 2021-02-04 12:21

I have several systems that all need to load the same properties to the JVM. I can use the -D flag to load one property at a time, but i am looking for something that will load

4条回答
  •  逝去的感伤
    2021-02-04 13:17

    That's roughly how we do it:

    java $(tr '\n' ' ' < options_file) other args...

    Here options_file contains ready -Dsomething or -Xsomething values, one per line. The tr command just replaces every newline with a space.

提交回复
热议问题