Linux to extract the war format package

Source: Internet
Author: User
Tags syslog

LinuxUnzip. WarPackage

the war format package resolves the Web application deployment without following the directory hierarchy, but instead uses the War package as a deployment unit.

Let's talk about how to unzip the . War format of the compressed package:

1, install the jdk, I installed is jdk1.7_64 version of, I in Baidu network disk upload a copy, is:Http://pan.baidu.com/s/1jGs22KQ

2, the JDK download after the first decompression to the specified directory (the directory according to their own circumstances, I put in the root directory for the aspect directly, the following configuration files are also based on this directory)

[[email protected] ~]# ls

An install.log jdk-7u76-linux-x64.gz mnt3 Download Documentation Video

Anaconda-ks.cfg install.log.syslog mydx_v.2.3.5_pr_15072502.war public Desktop Music

Anzhuangruanjian mnt Myipt.rule

Picture templates

3, decompression jdk-7u76-linux-x64.gz :

Tar xvf jdk-7u76-linux-x64.gz

Jdk1.7.0_76/include/linux/jni_md.h

Jdk1.7.0_76/include/jawt.h

Jdk1.7.0_76/include/jvmticmlr.h

Jdk1.7.0_76/include/classfile_constants.h

[[email protected] ~]# ls

An install.log jdk-7u76-linux-x64.gz mnt3 Download Documentation Video

Anaconda-ks.cfg install.log.syslog mydx_v.2.3.5_pr_15072502.war public Desktop Music

Anzhuangruanjian jdk1.7.0_76 mnt Myipt.rule

4. Enter jdk1.7.0_76

[[Email protected] jdk1.7.0_76]# CD

Configuring the Home directory of the JDK in environment variables

[Email protected] ~]# Vim/etc/profile

Pathmunge/usr/sbin after

Pathmunge/sbin after

Fi

Hostname= '/bin/hostname 2>/dev/null '

histsize=1000

If ["$HISTCONTROL" = "ignorespace"]; Then

Export Histcontrol=ignoreboth

Else

Export Histcontrol=ignoredups

46

Hostname= '/bin/hostname 2>/dev/null '

histsize=1000

If ["$HISTCONTROL" = "ignorespace"]; Then

Export Histcontrol=ignoreboth

Or else

Histcontrol=ignoredups Export

+ fi

54

Export PATH USER LOGNAME MAIL HOSTNAME histsize Histcontrol

Path= Export $PATH:/usr/local/mysql/bin

Add the following code, which depends on your situation:

=====================================================

Java_home=/root/jdk1.7.0_76

Jre_home=/root/jdk1.7.0_76/jre

Path= $PATH: $JAVA _home/bin: $JRE _home/bin

Classpath=.: $JAVA _home/lib/jt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib

Java_home jre_home PATH CLASSPATH

=======================================================

# By default, we want Umask to get set. This sets it for login shell

Threshold-current-system reserved Uid/gids is 200

# could check Uidgid reservation validity in

#/usr/share/doc/setup-*/uidgid File

If [$UID-gt 199] && ["' id-gn '" = "' Id-un '"]; Then

002 Umask

Or else

022 Umask

+ fi

71

in/etc/profile.d/*.sh for I; Do

If [-R "$i"]; Then

if ["${-#*i}"! = "$-"]; Then

75. "$i"

Else

5. See if the JDK is configured successfully after saving

Command

Java-version

[Email protected] ~]# java-version

Java Version "1.7.0_76"

Java (TM) SE Runtime Environment (build 1.7.0_76-b13)

Java HotSpot (TM) 64-bit Server VM (build 24.76-b04, Mixed mode)

The result is a successful configuration

6. Unzip the War pack

Command: jar

Parameters:

-C Create War package

-V Displays the creation process information

-U update war pack

-XVF Extract the contents of the war

It's easy to know these commands.

Now we need to unzip the war bag

JAR-VXF Ceshi.war

[Email protected] ~]# JAR-XVF Ceshi.war

Inflated:meta-inf/manifest. Mf

created:meta-inf/

created:web-inf/

created:web-inf/classes/

created:web-inf/classes/com/

created:web-inf/classes/com/mydx/

created:web-inf/classes/com/mydx/action/

Inflated:web-inf/classes/com/mydx/action/uploadaction.class

Inflated:web-inf/classes/struts.xml

created:web-inf/lib/

Inflated:web-inf/lib/ccp_rest_sdk_java_v2.6.3r.jar

Inflated:web-inf/lib/antlr-2.7.7.jar

Inflated:web-inf/lib/aopalliance-1.0.jar

Inflated:web-inf/lib/asm-5.0.2.jar

Inflated:web-inf/lib/asm-commons-5.0.2.jar

Inflated:web-inf/lib/asm-tree-5.0.2.jar

Inflated:web-inf/lib/bccs-api-lib-1.1.2.jar

Inflated:web-inf/lib/c3p0-0.8.5.2.jar

Inflated:web-inf/lib/cglib-nodep-2.1_3.jar

Inflated:web-inf/lib/ckeditor-java-core-3.5.3.jar

Inflated:web-inf/lib/classworlds-1.1.jar

Inflated:web-inf/lib/common_new.jar

Inflated:web-inf/lib/commons-beanutils-1.7.0.jar

Inflated:web-inf/lib/commons-chain-1.2.jar

Inflated:web-inf/lib/commons-collections-3.2.jar

Inflated:web-inf/lib/commons-digester-2.0.jar

Inflated:web-inf/lib/commons-fileupload-1.2.1.jar

Inflated:web-inf/lib/commons-io-1.3.2.jar

Inflated:web-inf/lib/commons-lang-2.4.jar

Inflated:web-inf/lib/commons-lang3-3.2.jar

Inflated:web-inf/lib/commons-logging-1.0.4.jar

Inflated:web-inf/lib/commons-logging-1.1.jar

Inflated:web-inf/lib/commons-logging-api-1.1.jar

Inflated:web-inf/lib/commons-net-ftp-2.0.jar

Inflated:web-inf/lib/commons-validator-1.3.1.jar

Inflated:web-inf/lib/dom4j-1.6.1.jar

Inflated:web-inf/lib/dwr.jar

Unzip the current directory.

So how to extract to the specified directory? Since the jar command does not support directly specifying the extract to a directory, you can first create a directory in which to execute the following command:

JAR-XVF. /ceshi.war

[Email protected] ~]# mkdir Ceshi

[Email protected] ~]# CD Ceshi

[Email protected] ceshi]# pwd

/root/ceshi

[Email protected] ceshi]# JAR-XVF. /ceshi.war

Inflated:meta-inf/manifest. Mf

created:meta-inf/

created:web-inf/

created:web-inf/classes/

created:web-inf/classes/com/

created:web-inf/classes/com/mydx/

created:web-inf/classes/com/mydx/action/

Inflated:web-inf/classes/com/mydx/action/uploadaction.class

Inflated:web-inf/classes/struts.xml

created:web-inf/lib/

/lib/commons-logging-api-1.1.jar

Inflated:web-inf/lib/commons-net-ftp-2.0.jar

Inflated:web-inf/lib/commons-validator-1.3.1.jar

Inflated:web-inf/lib/dom4j-1.6.1.jar

Inflated:web-inf/lib/dwr.jar

Inflated:web-inf/lib/ezmorph-1.0.4.jar

Inflated:web-inf/lib/freemarker-2.3.16.jar

Inflated:web-inf/lib/hibernate-c3p0-4.1.2.final.jar

Inflated:web-inf/lib/hibernate-commons-annotations-4.0.1.final.jar

Inflated:web-inf/lib/hibernate-core-4.1.4.final.jar

Inflated:web-inf/lib/hibernate-entitymanager-4.1.4.final.jar

[[email protected] ceshi]# ls

index.jsp js Meta-inf upload Web-inf

These files are extracted.

Finish

Linux to extract the war format package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.