各操作系統啟動java程序的腳本 – JAVA編程語言程序開發技術文章

Linux啟動java程序的通用處理工具
#!/bin/bash
JAVA_HOME=/usr2/exec_dir/java/jdk1.6.0_27
APPHOME=/usr2/exec_dir/manager/newIchk/Execution
MAIN=com.metarnet.Execution.ExecutionMain
CLASSPATH=$APPHOME/bin
for i in $APPHOME/LIB/*.jar
do   www.aiwalls.com

CLASSPATH=$CLASSPATH:$i

done
echo $CLASSPATH
${JAVA_HOME}/bin/java -DOmsExe -cp $CLASSPATH $MAIN 1 &

 
windows啟動linux的腳本

@echo off
set JAVA_HOME=D:\java\JDK
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('dir LIB /b ') do set CLASSPATH=!CLASSPATH!;./lib/%%i
set CLASSPATH=!CLASSPATH!;./bin;

start %JAVA_HOME%/bin/javaw -DOmsExecution -cp "%CLASSPATH%" com.metarnet.Execution.ExecutionMain

 

 

 

發佈留言