1.Shell Execute/Invoke Java/jar program
#!/bin/bashjava_home= "$HOME/jdk" base_dir= ' dirname "if [" $BASE _dir "= '. ') Then base_dir= ' pwd ' fiprocess_home= ' dirname $BASE _dir ' my_dir= ' $PROCESS _home/gasarchiveprocess "run_dir=" $MY _dir/ Rundir "lib_dir=" $MY _dir/lib "jvm_opts="-server-xms1024m-xmx1024m-dconfig_namespace=000-dgasarchiveprocess "LANG= Zh_cn. Utf-8jre_home= "$JAVA _home/jre" classpath= "$JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/rt.jar: $JRE _ Home/charsets.jar "mycp=" $LIB _dir/c3p0-0.9.1.2.jar: $LIB _dir/c3p0-oracle-thin-extras-0.9.1.2.jar: $LIB _dir/ Commons-beanutils-1.7.0.jar: $LIB _dir/commons-chain-1.1.jar: $LIB _dir/commons-codec-1.3.jar: $LIB _dir/ Commons-collections-3.2.1.jar: $LIB _dir/commons-configuration-1.0.jar: $LIB _dir/commons-dbcp.jar: $LIB _dir/ Commons-digester-1.6.jar: $LIB _dir/commons-discovery.jar: $LIB _dir/commons-email-1.1.jar: $LIB _dir/ Commons-fileupload-1.2.2.jar: $LIB _dir/commons-httpclient-3.1-rc1.jar: $LIB _dir/commons-io-2.0.1.jar: $LIB _dir/ Commons-jexl-1.1.jar: $LIB _dir/commons-lang-2.3.jar: $LIB _dir/commons-Logging-1.1.1.jar: $LIB _dir/commons-net-1.4.1.jar: $LIB _dir/commons-pool.jar: $LIB _dir/commons-validator.jar: $LIB _dir/daopub1.0.jar: $LIB _dir/gascommon.jar: $LIB _dir/gasdao.jar: $LIB _dir/ibatis-2.3.0.677.jar: $LIB _dir/ Ibsspub1.0.jar: $LIB _dir/log4j-1.2.15.jar: $LIB _dir/oracle10g.jar: $LIB _dir/slf4j-api-1.5.0.jar: $LIB _dir/ Slf4j-log4j12-1.5.0.jar: $LIB _dir/spring-beans.jar: $LIB _dir/spring-mock.jar: $LIB _dir/ Spring-security-core-2.0.3.jar: $LIB _dir/spring-webmvc-struts.jar: $LIB _dir/spring.jar: $LIB _dir/sysmgr1.5_zx.jar : $LIB _dir/sysmgrzxdao.jar: $LIB _dir/wlfullclient.jar "mycp=" $MYCP: $MY _dir/gasarchiveprocess.jar: $MY _dir/config:$ My_dir "Export java_home;export jre_home;export classpath;export lang;echo $MYCPecho $PROCESS _homeecho $MY _direcho $ Java_homeecho $CLASSPATHcd $RUN _dirjava $JVM _opts-ddacs_home= "$MY _dir"-CP "$MYCP" Com.eshore.gas.console.ArchiveProcessConsoleecho $! > Pidfile
2.Shell Kill Process
#!/bin/bashps-ef|grep java|grep Gasarchiveprocess|awk ' {print $} ' |xargs kill-9
Shell Run Java/jar Script