github下载java
3.编辑MyApp.xml文件git
<configuration> <id>MyApp</id> <name>MyApp</name> <description>This is MyApp.</description> <executable>java</executable> <arguments>-jar C:\Users\tanhw119214\Desktop\MyApp\MyApp.jar</arguments> <!-- 开机启动 --> <startmode>Automatic</startmode> <logpath>C:\Users\tanhw119214\Desktop\MyApp\logs</logpath> <log mode="roll-by-time"> <pattern>yyyyMMdd</pattern> </log> </configuration>
C:\Users\tanhw119214\Desktop\MyApp 为你要要注册服务的文件的父路径github
4.进入根目录下面,执行如下cmd命令,注册服务。windows
MyApp.exe install
而后在服务里面就能找到这个实例了。app
启动命令
net start MyApp
中止命令
net stop MyApp
卸载命令
sc delete MyAppspa
将命令写入到.bat文件,经过双击bat文件就能够启动项目3d
把这个命令写到.bat文件中,用管理员来执行这个bat文件code
test.bat文件写好了,以管理员身份运行这个文件xml
ok,服务建立成功了,取任务管理器看blog