日期:2014-05-17  浏览次数:20685 次

windows 批处理,运行程序。
@echo off
setlocal enabledelayedexpansion
set JAVA_HOME=..\jdk
set JAVA=%JAVA_HOME%\bin\java
set OPTS=-Xms512M -Xmx512M -Xss128k -XX:+AggressiveOpts -XX:+UseParallelGC -XX:NewSize=64M
set LIBPATH=libs
set ENGINE=build
set CP=%ENGINE%;
set MAIN=org.Main
  
for /f %%i in ('dir /b %LIBPATH%\*.jar^|sort') do (
   set CP=!CP!%LIBPATH%\%%i;
)
echo ===============================================================================  
echo.  
echo   Engine Startup Environment  
echo.  
echo   JAVA: %JAVA%  
echo.  
echo   JAVA_OPTS: %OPTS%  
echo.  
echo   CLASSPATH: %CP%  
echo.  
echo ===============================================================================  
echo.  

%JAVA% %OPTS% -cp %CP% %MAIN%
pause