Springboot system deployed in the windows above project and set its boot

Foreword

  Recent projects need to deploy a server on top of the customer's project and then test the system server is windows server2008 of previous projects are mostly deployed in linux system above, even when the windows system also play above themselves by command java -jar jar package ran this way. But this will be a problem, dos command window needs to remain open, if the dos command window accidentally closed, it would have to re-enter the command to start. . . Feel good trouble ah, but the black window always open, always feeling. . Ah, a little uncomfortable. So online access to information on the previous chiefs, and combined with their own hands to do some recording, convenient access to their own future, I hope you can help other novice like me oh!


 

  Installation jdk

 The first step is to install the required server jdk above, the command

java -version

 Check whether the installed jdk, my server is not installed just started, so I was the first step is to install the jdk.

 From my computer on top of the downloaded jdk uploaded to a server on top of the plate below, and then start the configuration environment variable.

 Configuration System Variables

 Find the path system variable, add in the back on the path jdk bin directory of your own, remember to open the front separated by a semicolon.

D:\app\Administrator\product\11.2.0\dbhome_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\jdk8\bin;

 As is my path configuration, the specific position after the penultimate semicolon is my jdk's bin directory.

 Configuring user variables 

 Find a user variable CLASSPATH (if not new), add the path where the jdk's lib directory.

C:\jdk8\lib

 As is the path of my lib.

 Verify that the installation was successful

 input the command

java -version

 You can see information about the jdk

java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

 Similar information appears as if to prove successful installation


 

  Installation WinSW

  Get WinSW

  WinSW is an open source project, program and source code can be downloaded at Git Hub in: https://github.com/kohsuke/winsw/releases

  Advantages: winsw is any application that can be registered as software services

 

   As shown, these two are what we need, we have to download them to the local.

  Configuration WinSW

  We downloaded the two files into our project jar with a directory, then WinSW.NET4.exe a change of name.

  I have here is changed myServer.exe, while the sample-minimal.xml also changed and exe files the same name, which is myServer.xml.

  Next you need to edit xml file look as follows.

< The Configuration >  
  <-! Service name after the installation into a windows service -> 
  < the above mentioned id > myServer </ the above mentioned id > 
  <-! Service names displayed -> 
  < name > myServer </ name > 
  <-! Service description -> 
  < the description > this is winsw generated service specifically for project start springboot </ the description >
  
  <! - path jdk executable program, we have installed jdk, as long as the "java" can -> 
  < Executable > the Java </ Executable > 
  <! - parameter -> 
  < arguments The > -jar JAR package name </ arguments > 
</ Configuration >

  


 

 

  Registration Service

   Open dos command window in the directory where myServer.exe, in order to prevent problems, it is best to open with an administrator.

   input the command

myServer.exe install

   After entering the computer services find our services: myServer, you can start right.

  

 

Guess you like

Origin www.cnblogs.com/YJzhiqianni/p/11890859.html