设置VM参数,设置java程序启动的classpath,默认的classLoader

1. --run.bat
set classpath
@echo call "set_class_path.bat"
call "set_class_path.bat"

@echo 设置Main-Class
set MAIN_CLASS=com.huawei.swingx.MainApp

if exist "%MAIN_CLASS%" goto okExec

:okExec
@echo okExec
@echo 如果是NT,启动java程序
if "%OS%" == "Windows_NT" start javaw -XX:PermSize=256M -XX:MaxPermSize=256M -Xms512M -Xmx512M -Xmn128M -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -verbose:gc -Xloggc:gc.log %MAIN_CLASS%

--set_class_path.bat
set classpath=.;lib\substance.jar;client\window-client.jar

2. 设置自定义ClassLoader
call "set_class_env.bat"
SET MAIN_CLASS=com.md.ejbx.client.MainApp

java -Djava.system.class.loader=com.md.cl.MClassLoader %MAIN_CLASS%

F:程序打包
cd \makjar
xcopy classes\com\huawei\swingx temp1\com\huawei\swingx  /W /E /Y /C /i
rd /s temp1\com\huawei\swingx\lookandfeel
jar cvf ui-client.jar -C temp1/ .
pause

你可能感兴趣的:(java,windows,OS)