crontab读不来环境变量

无法识别java

nohup: failed to run command `java': No such file or directory

那么在shell中加两行即可解决

. /etc/profile

. ~/.bash_profile

所有的文件如下:

#!/bin/bash
. /etc/profile
. ~/.bash_profile

java -Djava.ext.dirs=./lib -Djava.blarblar、、、

原文地址:https://www.cnblogs.com/zklidd/p/4387206.html