title: systemd Unable to find Java
body: <p>I'm facing a strange behaviour on a Centos Dist trying to run a bootable jar created with spring boot.</p>
  <p>If I run the jar app from the shell it runs perfectly</p>
  <p><a href="https://i.stack.imgur.com/2JIHM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2JIHM.png" alt="enter image description here" /></a></p>
  <p>When running the app with a service created with the following config:</p>
  <pre><code>[Unit]
  Description=app
  After=syslog.target
  
  [Service]
  ExecStart=/foo/bar/app.jar
  SuccessExitStatus=143
  
  [Install]
  WantedBy=multi-user.target
  ~
  </code></pre>
  <p>I keep getting the error &quot;Unable to find Java&quot;</p>
  <p><a href="https://i.stack.imgur.com/rBJKc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rBJKc.png" alt="enter image description here" /></a></p>
  <p>I checked the $PATH and $JAVA_HOME properties and they are set up correctly (I don't think this adds more information because the bootable jar runs correctly without beeing a service)</p>
  <p>What I'm doing wrong? Been messing around this problem for 3 days and it's driving me mad.</p>