bat脚本加载多个jar包至classpath启动工程

实例工程目录结构:
bat脚本加载多个jar包至classpath启动工程_第1张图片

bin:当前工程打包的jar文件
springboot_sample_jar:依赖包文件夹
startup-data.bat:启动脚本

启动脚本内容:

title springboot
@echo off  
set OPTS=-Xms512M -Xmx512M -Xss128k -XX:+AggressiveOpts -XX:+UseParallelGC -XX:NewSize=64M
set LIBPATH=springboot_sample_jar
set ENGINE=bin/springboot-sample.jar
set CP=%ENGINE%

echo ENGINE:%ENGINE%
set MAIN=com.sample.SampleMybatisApplication

set CP=%CP%;%LIBPATH%/*
echo ===============================================================================
echo.  
echo   Engine Startup Environment  
echo   CLASSPATH: %CP%  
echo.  
echo ===============================================================================  
echo.  
java -cp %CP% %MAIN% %OPTS%

你可能感兴趣的:(util)