JAva shell起動

1100 ワード

linuxの複数のjar間では、区切り記号として「:」を使用し、windowの下ではセミコロン「;」を使用します.
 
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
if "%JAVA_HOME%"=="" set JAVA_HOME=D:\tools\Java\jdk1.6.0_10
cd ../
set PROJECT_HOME=%cd%
set MAINCLASS=com._8qiu.ServerStarter
set CLASSPATH=%PROJECT_HOME%\config
 
for %%i in (%PROJECT_HOME%\lib\*.jar) do (
set CLASSPATH=!CLASSPATH!;%%i
)
 
%JAVA_HOME%/bin/java -classpath %CLASSPATH% %MAINCLASS%
@echo off      
rem     ....
setlocal enabledelayedexpansion   
rem java     
rem jvm     
set LIBPATH=%cd%\lib
rem      
set MAIN=com.cxrd.sendmessage.thread.SendMessageThread
set CP=!CP!;%CLASSPATH%
rem     jar    
for /f %%i in ('dir /b %LIBPATH%\*.jar^|sort') do (   
    set CP=!CP!%LIBPATH%\%%i;
)
echo JAVA: %JAVA%   
echo CLASSPATH: %CP%   
echo.
java -cp %CP% %MAIN%
PAUSE