1

I want run java application though shell script.The below is my demo shell script. nohup java -cp .:$CLASSPATH com.xx.xx.App >> path/to/xx.log & but get this error: nohup: failed to run command ‘java’: No such file or directory someone can solve this question? thx!

LU KONG
  • 59
  • 1
  • 3
  • 12
  • https://stackoverflow.com/questions/10193824/nohup-error-no-such-file-or-directory should be considered when encountering these type issues – Paul Jul 31 '18 at 16:11

1 Answers1

1

I solved this question by add this line to my shell script. source ~/.bashrc This method is reload system environment. Then shell script can use java command.

LU KONG
  • 59
  • 1
  • 3
  • 12