Reputation: 393
I am creating an executable jar for my application using maven-assembly-plugin
which will include all my dependencies in it. I also want to set few JVM arguments for this to increase the memory allocated to it while running the jar.
I do not want the end user to go to command prompt and set these values, I want to be set inside the jar, so that the user can just run my jar directly.
Any help would be appreciated.
Thanks in advance.
Upvotes: 1
Views: 2565
Reputation: 718698
If you provide / expose the JAR file to users, it is impossible to stop them supplying JVM arguments on the command line.
The closest you are going to get to your goal is to provide users with a wrapper script or launcher to run the JAR, and "hide" the JAR from them.
Upvotes: 0
Reputation: 2573
There is no way to include these JVM requirements in the jar, but probably the best you can do is to include a run script with your jar.
Upvotes: 1