How to specify JVM argument for Maven built executable JAR

前端 未结 5 1968
梦谈多话
梦谈多话 2020-12-19 06:16

When using Maven to build an executable JAR, how do I specify the JVM arguments that are used when the JAR is executed?

I can specify the main class using <

5条回答
  •  庸人自扰
    2020-12-19 06:55

    In response to David Carlson's answer, you can make it less brittle by using the java.home system property to locate the java executable instead of relying on the user's path to find it. In addition you should probably be redirecting standard input to the child process as well.

提交回复
热议问题