I wrote a bash script to execute my jar file in ubuntu or Red Hat environment. Here is my bash script
#!/bin/bash JAVA_HOME=/usr/lib/java/jdk1.8.0_131 $nohup java -jar /home/chikin/Downloads/hardcoded.jar & tail -f nohup.out
My bash script will execute the jar that i had developed, i hope to print out the output from the jar file into
nohup.out or any txt file,so i can trace out any problem easily but it's seem like no printing out anything when i execute the script, it's print out all the output in terminal. But when i execute
nohup java -jar /home/chikin/Downloads/hardcoded.jar & directly from the terminal, it's able to print all the jar output into nohup.out. May i know why my script not working ?
My script also not able to trigger every time i reboot my ubuntu machine, i tested many of the solutions but none of them working well