title: Java - how to use forever tool for the jar file?
body: <p>On CentOS 7 i have <code>/home/www/html/java-server/Objects/server.jar</code> file which time to time crash for good reason and need to re-start again automatic so that its always running.</p>
  
  <p>How to use <code>forever</code> like tool or any other similar for Java on CentOS? </p>
  
  <p>For example on my NodeJS server i use as below.</p>
  
  <pre><code>forever start --minUptime 1000 --spinSleepTime 1000 SERVER.js
    or 
  forever -m5 server.js
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Reference: <a href="https://stackoverflow.com/a/28704296/285594">https://stackoverflow.com/a/28704296/285594</a></p>