What is the difference between a 'jar' file and a 'war' file

Discussions

General J2EE: What is the difference between a 'jar' file and a 'war' file

  1. Hi !
    Could anyone tell me what is the exact difference between a 'jar' file and a 'war file.

    Thanks
    AJP
  2. Hi AJP,

    For making JAR and WAR we follow , the following process ,

    Create Component -> Create Component DD -> Create Component Archive.

    NOW WAR , stands for Web Archive which holds Servelts , JSP pages , Web pages.

    Servlets + JSP Pages + Web Pages = [.War file ]

    while JAR file is a EJB ,

    EJB = [.jar file]

    For an Application we typically have ,

    [.JAR] + [. WAR] = [. EAR]

    .EAR is an Enterprise Archive ( Application Archive)



    So in all it is just a terminology to identify what your archive contains .


    - Abhijit