Since the project deployment needs to execute the Xxxx.jar file on the Windows Server, written as bat file, normal we execute the background command start%java_home%\bin\javaw.exe-jar Xxx.jar, is able to start the program, but the process found in the background is javaw.exe, if more than one jar started, we do not know to stop the application, so we need to name the process, we use copy javaw.exe rename way: Copy "%java_home%\ Bin\javaw.exe "%java_home%\bin\xxx.exe" so that we can find the specific process name.
First, start the script Start.bat
@echo Offrem setting JDK path set java_home= "C:\Java\jdk1.7.0_15" rem rename Javaw.exe to the specified name copy "%java_home%\bin\javaw.exe"%java_ Home%\bin\xxx.exe "REM execution jar file with specified name Javaw.exe start" Lock-server "%java_home%\bin\xxx.exe"-jar Xxx.jar
Second, stop the script Stop.bat
Taskkill-f-t-im XXX.exe
BAT file for start and stop commands under Windows