Understand the war and package jar package

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/cxh6863/article/details/101171203

I. INTRODUCTION

1、war

war package is a web application format proposed by Sun, is a packaging format, similar to the jar, many files are compressed, packaged into a java web project to publish the war package, this package is packaged files are java web All files in the project, not a missing directory. When you publish the war package placed under the direct tomca directory webapp, restart the service to run the project.

2、jar

JAR is a platform-independent file format, is a kind of archive building in ZIP format to .jar file extension, and ZIP files is different, not only for the JAR file compression and distribution, but also for deployment library package and, components and plug-ins, and may be such as compilers and tools JVM directly.
jar package is that some people have written class, then to package these classes. These jar package can be introduced into your project, you can use these jar package classes and attributes directly.
Simply put, the jar package is generally referenced to others, inside some class files.

Second, the same

jar package and the war package is dependent on the code and something compressed together into a .jar file extension .war and the
jar package and the package can be seen as war compressed files, using decompression software can open.

Third, the difference

1.war package is javaweb play package, including the whole thing, write the code is compiled into class files, depending on the package configuration file, all pages of the site, including html, jsp, etc., that is, there are projects in the everything;
jar package which is only compiled class files and some deployments
2.war file is equivalent to a web application; the jar file is to package classes and some related resources into a package, convenience of references to
3. war package is not suitable for use in the development stage, suitable for use in stage stages of product release

Guess you like

Origin blog.csdn.net/cxh6863/article/details/101171203