Java应用程序工程模板2011-04-05 51cto博客 leizhimin自己常用的一个java应用程序模板,节省了不少时间!包含很多脚本:一、启动脚本starup.bat set APP_LIBDIR=..lib setlocal EnableDelayedExpansion set APP_CLASS_PATH=%XFIRE_HOME% for %%c in ("%APP_LIBDIR%*.jar") do set APP_CLASS_PATH=! APP_CLASS_PATH!;%%c set APP_CLASS_PATH java -cp %APP_CLASS_PATH% com.lavasoft.TestMain
startup.sh #!/bin/sh programdir="." program="com.lavasoft.TestMain" num=$# temp=$CLASSPATH #setting libs path libs=../lib/* append(){ temp=$temp":"$1 } for file in $libs; do append $file done export CLASSPATH=$temp:.:../:$programdir export LANG=zh_CN res=`ps aux|grep java|grep $program|grep -v grep|awk "{print $2}"` if [ -n "$res" ] then echo "TestMain already running" else java -classpath $CLASSPATH com.lavasoft.TestMain & sleep 3 unset res res=`ps aux|grep java|grep $program|grep -v grep|awk "{print $2}"` if [ -n "$res" ] then echo "TestMain start success" else echo "TestMain start error" fi fi