说明:bat与jar放同一目录
1.
bat内容为:
@echo off
set APP_HOME=%cd%
echo 设置当前路径=%APP_HOME%
set JAVA_HOME=D:/J2EE/Java/jdk1.6.0_43
echo 设置JAVA_HOME=%JAVA_HOME%
echo 运行jar
start "" "%JAVA_HOME%/bin/javaw.exe" -jar %APP_HOME%/freeStudio.jar
echo 运行成功
echo. & pause
2.
@echo off
start D:\\J2EE\\Java\\jdk1.6.0_43\\bin\\java -jar somejar.jar