zoukankan      html  css  js  c++  java
  • 利用Java Service Wrapper将java项目添加到windows服务中

    1、web项目,即tomcat/resin添加至window系统服务,步骤如下:
    第一步:找到tomcat的bin目录,如:D:apache-tomcat-8.0.26in
    第二步:打开cmd,cd到该目录,执行:service.bat install 即可将tomcat添加至服务中;
    同理,打开cmd,cd到该目录,执行:service.bat remove 即可将tomcat从服务中删除;
    注意:修改service.bat中SERVICE_NAME/DISPLAYNAME即可修改服务名称和服务描述;
    set SERVICE_NAME=Tomcat8 ----服务名称
    set DISPLAYNAME=Apache Tomcat 8.0 %SERVICE_NAME% ----服务描述

    2、java程序添加至window系统服务,步骤如下:
    第一步:下载java serverice wrapper;解压至文件夹wrapper中;Java Service Wrapper官网:http://wrapper.tanukisoftware.com/doc/english/download.jsp
    第二步:建目录;新建一个文件夹,如:CommInsert目录,在该目录下新建四个目录,分别是:lib、bin、logs、conf;
    第三步:拷贝wrapper;
    将下载的wrapper/lib下的wrapper.dll、wrapper.jar拷贝至CommInsert/lib下;
    将下载的wrapper/src/bin下App.bat.in、InstallApp-NT.bat.in、UnistallApp-NT.bat.in拷贝至CommInsert/bin下,并去掉后缀.in;
    将下载的wrapper/bin下的wrapper.exe拷贝至CommInsert/bin下;
    将下载的wrapper/logs下的wrapper.log拷贝至CommInsert/logs下;
    将下载的wrapper/conf下的wrapper-license.conf、wrapper.conf拷贝至CommInsert/conf下;
    第三步:拷贝java项目;
    将java项目打包成jar包,如CommInsert-1.0.0a.jar;将该jar包以及该java程序所依赖的第三方jar包,拷贝至CommInsert/lib下;
    将该java程序需要的配置文件conf目录拷贝至CommInsert/bin下;
    第四步:修改wrapper.conf配置文件;

    #1、 项目jar包和所有第三方jar包的引用
    #Java Classpath (include wrapper.jar) Add class path elements as
    # needed starting from 1
    wrapper.java.classpath.1=../lib/CommInsert-1.0.0a.jar
    wrapper.java.classpath.2=../lib/wrapper.jar
    wrapper.java.classpath.3=../lib/ant.jar
    wrapper.java.classpath.4=../lib/classes12.jar
    wrapper.java.classpath.5=../lib/commons-collections4-4.0.jar

    #2、 启动项目的主方法Java Main class.
    wrapper.java.mainclass=com.genius.InsertMain

    #3、 控制台的名称Title to use when running as a console
    wrapper.console.title=CommInsert

    #4、服务名称 Name of the service
    wrapper.name=CommInsert

    #5、服务描述 Display name of the service
    wrapper.displayname=CommInsertDisPlay

    第五步:安装服务;
    启动程序:双击CommInsertinApp.bat;
    启动无误后,安装服务:双击CommInsertin下的InstallApp-NT.bat;
    删除该服务:双击CommInsertin下的UninstallApp-NT.bat;

  • 相关阅读:
    [NOI2015]程序自动分析
    D-query(莫队)
    小B的询问
    组合的输出 (dfs+记忆化)
    组合的输出 (dfs+记忆化)
    5719: 集合的划分(dfs)
    Search for a range, 在一个可能有重复元素的有序序列里找到指定元素的起始和结束位置
    Find Min In Rotated Sorted Array2,包含重复数字的反转序列找最小值。
    Find Min In Rotated Sorted Array,寻找反转序列中最小的元素。
    Search In Rotated SortedArray2, 有重复数据的反转序列。例如13111.
  • 原文地址:https://www.cnblogs.com/champaign/p/5717504.html
Copyright © 2011-2022 走看看