区别:Jar、war、EAR、在文件结构上,三者并没有什么不同,它们都采用zip或jar档案文件压缩格式。但是它们的使用目的有所区别:

  Jar文件(扩展名为. Jar,JavaApplication Archive)包含Java类的普通库、资源(resources)、辅助文件(auxiliary files)等

  War文件(扩展名为.War,Web Application Archive)包含全部Web应用程序。在这种情形下,一个Web应用程序被定义为单独的一组文件、类和资源,用户可以对jar文件进行封装,并把它作为小型服务程序(servlet)来访问。

  Ear文件(扩展名为.Ear,Enterprise Application Archive)包含全部企业应用程序。在这种情形下,一个企业应用程序被定义为多个jar文件、资源、类和Web应用程序的集合。

  每一种文件(.jar, .war, .ear)只能由应用服务器(application servers)、小型服务程序容器(servlet containers)、EJB容器(EJB containers)等进行处理。

EAR文件包括整个项目,内含多个ejb module(jar文件)和web module(war文件)

These files are simply zipped files using the java jar tool. These files are created for different purposes. Here is the description of these files:

  • .jar files: The .jar files contain libraries, resources and accessories files like property files.

  • .war files: The war file contains the web application that can be deployed on any servlet/jsp container. The .war file contains jsp, html, javascript and other files necessary for the development of web applications.

.jar and .war are both zipped archived files. Both can have the optional META-INF/MANIFEST.MF manifest file which hold informative information like versioning, and instructional attributes like classpath and main-class for the JVM that will execute it.

.war file - Web Application Archive intended to be execute inside a 'Servlet Container' and may include other jar files (at WEB-INF/lib directory) compiled classes (at WEB-INF/classes (servlet goes there too)) .jsp files images, files etc. All WAR content that is there in order to create a self-contained module.

jar war的更多相关文章

  1. jar,war,ear区别及java基础杂七八

    jar,war,earqu区别 这三种文件都可以看作是java的压缩格式,其实质是实现了不同的封装: jar--封装类war--封装web站点ear--封装ejb.它们的关系具体为:jar:      ...

  2. Maven配置jar(war)包自动打包上传Maven服务器的配置

    Maven配置jar(war)包自动打包上传Maven服务器的配置 创建jar(war)包工程 创建一个maven工程 在工程中穿件一个测试类 配置pom.xml <distributionMa ...

  3. java打包jar,war,ear包的作用、区别

    java的打包jar,war,ear包的作用,区别,打包方式. a) 作用与区别      i.    jar: 通常是开发时要引用通用(JAVA)类,打成包便于存放管理      ii.   war ...

  4. Maven将依赖包、jar/war包及配置文件输出到指定目录

    使用Maven插件将依赖包 jar包 war包及配置文件输出到指定目录 写在前面 ​ 最近遇到一个朋友遇到一个项目需要将 maven 的依赖包和配置文件分开打包然后用脚本执行程序.这样的好处在于可以随 ...

  5. Jar/War/Ear等包的作用与区别详解

    以客户角度来看,jar文件就是一种封装格式,用户不需要知道jar包中有多少个.class格式的文件及每个文件中的功能与作用,也可以得到相应的访问的结果.java中除了jar格式还有war和ear等包文 ...

  6. jar/war/ear文件的区别

     jar/war/ear三种文件,在文件结构上,三者并没有什么不同,它们都采用zip或jar档案文件压缩格式.但是它们的使用目的有所区别: Jar文件(扩展名为. Jar)包含Java类的普通库.资源 ...

  7. JAR,WAR,EAR的使用与区别

    WAR(Web Archive file)网络应用程序文件   是与平台无关的文件格式,它允许将许多文件组合成一个压缩文件.为 J2EE 应用程序创建的 JAR 文件是 EAR 文件(企业 JAR 文 ...

  8. Spring Boot Executable jar/war 原理

    spring boot executable jar/war spring boot里其实不仅可以直接以 java -jar demo.jar的方式启动,还可以把jar/war变为一个可以执行的脚本来 ...

  9. jar命令+7z:创建,替换,修改,删除Jar, war, ear包中的文件

    虽然现在已经有各种智能的IDE可以为我们生成jar包,war包,ear包,甚至带上了自动替换,部署的功能.但一定会有那么些时候,你需要修改或是替换jar包,war包,ear包中的某个文件而不是整个重新 ...

随机推荐

  1. 51nod 1013快速幂 + 费马小定理

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1013 这是一个等比数列,所以先用求和公式,然后和3^(n+1)有关,有n ...

  2. java判断request请求是手机还是pc终端

    /** * 判断请求是否手机端 * @param req * @return */ public static boolean isMobile(HttpServletRequest req) { U ...

  3. NPOI导出模板样式

    /// <summary> /// 导出多种车辆统计表格 /// </summary> /// <returns></returns> [ActionN ...

  4. ASP.NET MVC 扩展HtmlHelper类方法

    1.扩展HtmlHelper类方法ShowPageNavigate 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ...

  5. OPENGL的入门第一个程序——Hello World

    #include "stdafx.h" #include<GL\glut.h> void Init() { glClearColor(0.0f,0.0f,0.0f,0. ...

  6. linux下进程权限分析

    转自http://blog.chinaunix.net/uid-27105712-id-3349522.html 在linux下,关于文件权限,大部分人接触比较多,也比较熟悉了解.但是对进程权限一般知 ...

  7. 【bzoj2456】 mode

    http://www.lydsy.com/JudgeOnline/problem.php?id=2456 (题目链接) 只看了一眼,直觉便告诉我这是水题.于是跟某码农打赌说10分钟做出来叫爸爸,结果输 ...

  8. Metro-UI系统-2-color和icon

    1.上图 Color icon 2. 怎么用 2.1 color使用 <!--1,设置背景和前景色--> <div class="tile bg-blue fg-white ...

  9. DIV横排/竖排滚动(white-space/::-webkit-scrollbar的使用技巧以及display: inline-block的选择)支持手势

    参考微信的京东客户端http://wqs.jd.com/,实现DIV的横排滚动,且支持手势,并且不会出现滚动跳,效果如下: 但是观察其div结构是没有使用任何JS去实现. 一.实现上DIV的横排 观察 ...

  10. linux最常用的20条命令

    玩过Linux的人都会知道,Linux中的命令的确是非常多,但是玩过Linux的人也从来不会因为Linux的命令如此之多而烦恼,因为我们只需要掌握我们最常用的命令就可以了.当然你也可以在使用时去找一下 ...