• jar 包和 war 包的区别


    Definition--定义

    A JAR(Java Archive) file is a file with Java classes, associated metadata, and resources such as text and images aggregated into one file.

    A WAR(Web Application Resource or Web Application Archive) file is a file that is used to distribute a collection of JAR files, JSP, Servlet, XML files, static web pages like HTML and other resources that constitute a web application.

    An EAR file is a standard JAR file that represents the modules of the application, and a metadata directory called META-INT which contains one or more deployment descriptors. Thus, this is the main difference between JAR WAR and EAR files.

    File Extension-扩展名

    A JAR file has the .jar file extension .

    A WAR file has the .war file extension.

    An EAR file has the .ear file extension.

    Usage--用途

    JAR file allows Java Runtime Environment (JRE) to deploy an entire application including the classes and related resources in a single request.

    WAR file allows testing and deploying web applications easily

    Conclusion--总结

    The JAR file is a file that has Java class files, related metadata, and resource combined into a single file to execute a Java application.

    The WAR file is a file that contains files such as a servlet, JSP, HTML, JavaScript, etc. that are necessary to develop web applications.

    EAR is a Java EE file that packages one or more modules into a single archive to deploy them on to an application server. 

    【引文】https://pediaa.com/what-is-the-difference-between-jar-war-and-ear/ 

  • 相关阅读:
    JVM之GC调优
    JVM的栈、堆
    SpringMVC及其HandlerMapping、HandlerInterceptor、HandlerAdapter等组件的原理解析
    静态代理、动态代理和CGLIB,SpringAOP中的代理
    cmd删除文件夹
    vue-router命名视图+路由嵌套
    Vue实现长按事件
    [SparkSQL] hive.exec.max.dynamic.partitions配置不起作用
    Excel分数转为百分数
    Hadoop YARN主资源调度算法
  • 原文地址:https://www.cnblogs.com/live-for-learning/p/12253829.html
Copyright © 2020-2023  润新知