PHP中文网2017-04-17 15:02:48
Use -Djava.ext.dirs
directly to automatically load JAR
files, eliminating the need to load them one by one.
java -Djava.ext.dirs=$RUN_LIB -jar *.jar > $LOG_FILE &
阿神2017-04-17 15:02:48
First: *.jar should be avoided writing this way. If one day a teammate throws a jar package into it for you, problems may occur.
Second: In your shell script:
LIB_CLASS = '.'
This .
should refer to the crontab working directory (PWD), which is the user’s default directory, so if you have a class file under /home/user/crontab-job/projectX
, your classpath It should not be included.