单运行jar
java -jar xxx.jar
执行依赖包运行jar
lib文件夹和jar同级
java -jar -Dloader.path="lib/" xxx.jar
设置编码运行jar
设置控制台编码为utf-8
chcp 65001
java -jar -Dloader.path="lib/" xxx.jar
设置jdk目录运行jar
chcp 65001
set JAVA_HOME=D:\dev\jdk-11.0.12
set Path=%JAVA_HOME%\\bin;
java -jar -Dloader.path="lib/" xxx.jar
后台运行jar
@echo off
set JAVA_HOME=D:\dev\jdk-11.0.12
set Path=%JAVA_HOME%\\bin;
start javaw -jar -Dloader.path="lib/" xxx.jar
exit
标签:bat,set,java,lib,windows,xxx,jar,JAVA,分享
From: https://www.cnblogs.com/sstu/p/17151572.html