1. Package with jar command
// Package the current directory into a war package
jar cvf temp.war */ .
Command format:
java cvf package file name directory to be packaged package file save path
Decompression is naturally:
jar xvf temp.war
jar is similar to the tar command under linux
2. Use eclipse
to right-click on the WebRoot, select the Export option,
then select the J2EE WAR file option, then select the project name and path, and click Finish.