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?