2、java项目启动windows脚本
2017-11-16 本文已影响0人
ltjxwxz
setlocal enabledelayedexpansion
set JAVA_HOME=D:\Program Files (x86)\Java\jdk1.6.0_30
set PATH=%JAVA_HOME%/bin;%PATH%
set MY_HOME=.
echo %MY_HOME%
set LIBPATH=%MY_HOME%/lib
echo %LIBPATH%
set _classpath=%MY_HOME%/conf
set LIB_DEPLOY_CLASSPATH=".;%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar"
set LIB_DEPLOY_CLASSPATH=%LIB_DEPLOY_CLASSPATH%;%_classpath%
for %%i in (%LIBPATH%\*.jar) do set LIB_DEPLOY_CLASSPATH=!LIB_DEPLOY_CLASSPATH!;%%i
echo %LIB_DEPLOY_CLASSPATH%
java -Dfile.encoding=GBK -Dclient.encoding.override=GBK -classpath %LIB_DEPLOY_CLASSPATH% org.testng.TestNG testng.xml
该脚本仿照dubbo官方给出的测试项目中的start.sh改写的,依次是:
设置java home,
设置path,
设置项目目录,
设置lib包所在目录,
设置conf配置文件所在目录
设置运行时classtpath:javahome下jar包,conf下配置文件,lib下所有jar包
启动