I have a server (Ubuntu 14.04.4 LTS) and want a certain Java application to run on it all the time. Currently I start it using
nohup gradle run &
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 137
As said in comments it is an Out Of Memory Exception, you can do:
Rewiev you code, maybe you can have low performances in your code.
If you are running a simple "java application" you can, instead click "Run As.. Java Application" click "Run As.. Run Configration", select your java application and in TAB "Arguments", "VM Arguments" add this parameters:
with this parameters you allocate a minimum of 512M on your application (at the start) and a maximum of 1024M. You can enlarge this numbers as needed.