1

I've want to start a JAR file through a service script file or normal bash script. If I try the following in the command line, it is working all great. The JAR file runs in background and also if I end the SSH session:

nohup /opt/java/jdk8_x32/jre/bin/java -jar /home/test/DoOnLANServerAgent_1.0.0-SNAPSHOT.jar &

If I use exactly the same from within a bash script file, the JAR wouldn't launch and the process is never running. This occurs also, if I use a normal service script in /etc/init.d/myservice. The process won't start, I always have to open up the terminal and manually start the Java program.

Is there any solution for my problem?

marc3l
  • 2,525
  • 7
  • 34
  • 62
  • Have a look at the answer to this question http://stackoverflow.com/questions/11203483/run-a-java-application-as-a-service-on-linux - use the script, it works perfectly fine – baao Jan 26 '17 at 12:14
  • @Baao I am using exactly this script, but my process is canceled immediately after start. My program contains an infinite loop and System.out.println's. Eventually this is the problem? – marc3l Jan 26 '17 at 12:20

0 Answers0