windows 64位上把java程序注册为服务的procrun
之前用windows wrapper,但是wrapper在64位windows上的版本是付费的。后来上网找到了这个工具。大家熟悉的Tomcat就是用它做的服务。配置挺简单的。文件下载之后基本配置如下: 把prunsrv.exe 和prunmgr.exe 复制到和app同一个目录下。 把prunmgr.exe改名为app名称yourappname.exe。 写一个安装服务脚本文件install.bat: set APP_HOME=****** %APP_HOME%\prunsrv.exe //IS//servicename --DisplayName="servicename" --Install=%APP_HOME%\prunsrv.exe 写一个卸载服务脚本文件uninstall.bat: set APP_HOME=****** %APP_HOME%\prunsrv.exe //DS//servicename 双击运行install.bat注册服务。注册完成后就可以运行改了名称后的yourappname.exe进行服务具体参数的配置。 也可以在安装服务脚本文件中加入其它的命令参数。