Win下执行Swing程序的BAT文件 和 Linux下执行Swing程序的SH文件
BAT文件:
@echo off set CLASSPATH_BAK=%CLASSPATH% set classpath=%CLASSPATH%;.\lib\commons-codec-1.3.jar;.\lib\commons-httpclient-3.0.jar;.\lib\commons-logging-1.0.4.jar;.\lib\dom4j-1.6.1.jar;.\lib\httpcore-4.0.jar;.\lib\jaxen-1.1-beta-9.jar;.\lib\log4j-1.2.14.jar;.\lib\mail.jar;.\lib\activation.jar;abc.jar start javaw com.abc.Main set classpath=%CLASSPATH_BAK%
SH文件:
#!/bin/sh export PATH=/opt/ibm/java-x86_64-60/bin:$PATH export JAVA_HOME=/opt/ibm/java-x86_64-60 export JRE_HOME=/opt/ibm/java-x86_64-60/jre export CLASSPATH=/opt/ibm/java-x86_64-60/lib:/opt/ibm/java-x86_64-60/jre/lib:$CLASSPATH RUN_HOME=/root/rttsTest CLASSPATH=$CLASSPATH$RUN_HOME/lib/commons-codec-1.3.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/commons-httpclient-3.0.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/commons-logging-1.0.4.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/dom4j-1.6.1.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/httpcore-4.0.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/jaxen-1.1-beta-9.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/log4j-1.2.14.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/mail.jar CLASSPATH=$CLASSPATH:$RUN_HOME/lib/activation.jar CLASSPATH=$CLASSPATH:$RUN_HOME/abc.jar export CLASSPATH=$CLASSPATH javaw com.abc.Main