LU KONG
LU KONG

Reputation: 79

nohup: failed to run command ‘java’: No such file or directory

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!

Upvotes: 2

Views: 12047

Answers (2)

Peter
Peter

Reputation: 493

I had a same issue it got resolved by installing jre on the server

Upvotes: 0

LU KONG
LU KONG

Reputation: 79

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.

Upvotes: 2

Related Questions