java - Linux 运行有依赖的Jar失败
PHPz
PHPz 2017-04-17 15:00:48
0
2
646
PHPz
PHPz

学习是最好的投资!

reply all(2)
Ty80

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  &
阿神

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!