title: How to specify JVM Parameters inside Spring Boot Project when executed with init.d
body: <p>I have a Spring Boot project that I'm running as an executable jar started as an init.d service on Linux.</p>
  
  <p>I understand I can create a .conf file with the same name as the jar file to specify JVM parameters.  However, I would ideally like to "hard code" some parameters so there is no risk of the .conf file being missing.  This is a real risk as each deployment will have a different jar name because of the version number.</p>
  
  <p>Also I know I can set the environment variable JAVA_OPTS, but I'm not sure how to do this if I'm launching the Spring Boot as a init.d service using a symlink to the jar file.</p>
  
  <p>Lastly I know I can replace the init.d script completely using the <a href="https://docs.spring.io/spring-boot/docs/current/maven-plugin/repackage-mojo.html#embeddedLaunchScript" rel="nofollow noreferrer">embeddedLaunchScript</a> parameter, but I fell this overkill for what I want to accomplish and would want updates to the script in further releases.</p>
  
  <p>Is there a way to specify JVM parameters in the Maven plugin or some other programmatic method?</p>
  
  <p>Alternatively is there a way to hard code a static CONF file name?  Looking at the <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html#deployment-script-customization-when-it-written" rel="nofollow noreferrer">embeddedLaunchScriptProperties</a> it looks like confFolder can the folder, but not the name of the .conf file.</p>