脚本含义
以下是一个启动java进程的脚本,但是看不懂,麻烦大侠们有懂得给解释一下,多谢啦!
#!/bin/ksh
export JAVA_HOME=/opt/java1.6
export PATH=/opt/java1.6/bin:/opt/java1.6/jre/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/bin:/opt/apache-ant-1.8.2/bin:/data1/misc/bin
nohup java -Xms1024m -Xmx1024m -Djava.ext.dirs=../lib -classpath /opt/java1.6/opt/java6/jre/lib/ext/sunjce_provider.jar:../config/:../:../app/webclie
nt.jar com.asiainfo.boss4.bmcc.WebserviceClientAction WebserviceClient ../config/log4j_client.xml &
------解决方案--------------------你不理解的是java的一堆-X、-classpath参数,还是这三行shell命令?
这里shell只用了export定义环境变量,以及用nohup xxx &后台运行java程序,并防止你退出shell后被终止。
------解决方案--------------------#!/bin/ksh
# 设置JAVA_HOME环境变量
export JAVA_HOME=/opt/java1.6
# 在PATH环境变量中加入java的路径以便执行java命令
export PATH=/opt/java1.6/bin:/opt/java1.6/jre/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/bin:/opt/apache-ant-1.8.2/bin:/data1/misc/bin
# 用 nohup xxoo & 的方式把java应用启动起来并放到后台运行
# 让进程在后台可靠运行的几种方法 http://bbs.chinaunix.net/thread-1118626-1-1.html
nohup java -Xms1024m -Xmx1024m -Djava.ext.dirs=../lib -classpath /opt/java1.6/opt/java6/jre/lib/ext/sunjce_provider.jar:../config/:../:../app/webclient.jar com.asiainfo.boss4.bmcc.WebserviceClientAction WebserviceClient ../config/log4j_client.xml &