First, download
http://wrapper.tanukisoftware.com/doc/english/download.jsp
Download package
Wrapper-linux-x86-64-3.5.30.tar.gz
Extract
Tar xvf/usr/file/wrapper-linux-x86-64-3.5.30.tar.gz-c/usr/java/
Renaming
CD/USR/JAVAMV wrapper-linux-x86-64-3.5.30 Wrapper
Second, the test code
Create a simple MAVEN project called Code, and write a main class Main.java
Package Com.xmyself.code;public class Main {public static void main (string[] args) {System.out.println ("Start wrapper suc Cess ");}}
Package as jar file, full name Code-0.0.1-snapshot.jar, place file in CentOS/usr/file directory
Third, the configuration
Go to configuration file directory
Cd/usr/java/wrapper/conf
Edit wrapper.conf
VI wrapper.conf
Modify the following content
# Java Main class. This class must implement the Wrapperlistener interface# or guarantee so the Wrappermanager class is Initialized.
helper# classes is provided to does this for you . See the integration section# of the documentation for details.wrapper.java.mainclass=com.xmyself.code.main# Java Classpath (include Wrapper.jar) Add class path elements as# needed starting from 1wrapper.java.classpath.1=. /lib/wrappertest.jarwrapper.java.classpath.2=. /lib/wrapper.jarwrapper.java.classpath.3=/usr/file/code-0.0.1-snapshot.jar# Name of the Servicewrapper.name= testwrapper# Display Name of the servicewrapper.displayname=test Wrapper Sample application# Description of the Servicewra Pper.description=test Wrapper Sample Application Description
Four, start
Enter the bin directory of the wrapper
Cd/usr/java/wrapper/bin
Start
Wrapper-c. /conf/wrapper.conf
The console will always run the code in Code-0.0.1-snapshot.jar and continue to output "start wrapper success"
Wrapper Simple to use