-CP and-classpath Specify the paths of other classes that the class runs on, usually the class library, the jar pack, and so on
Windows semicolon ";" separated by semicolons on Linux: "Delimited." Use a little "." Represents the current path (instance not applied)
/usr/java/jdk1.6.0_18/bin is $java_home JDK directory written separately JAVA-CP can also be executed
Instance:
#!/bin/sh
export lang= "ZH_CN. GB18030 "
path= $PATH: $HOME/bin
db2insthome=/home/db2inst/sqllib
export db2insthome
if [F $ Db2insthome/db2profile]; Then
. $DB 2insthome/db2profile
fi
export PATH
echo ' Start---do '
/usr/java/jdk1.6.0_18/bin /java -dfile.encoding=gbk-cp/home/testftp/temp_0802/log4j-1.2.11.jar:/home/testftp/temp_0802/monitor1.jar Com.cn.test.Testtwo
echo '---the--end--'
The shell script finally specifies the Main method entry: Package name + class name
Last Crontab-e
5/* * * * */opt/ripamonitor.sh >>/opt/ripamonitor.log
Execute every 5 minutes