Difference Between JAR and WAR
1.The main difference between JAR files and WAR files is that one can package many different things in JAR files. It is most commonly used to package Java classes, but a lot of other things can be packaged as well. However, WAR files are specifically for web applications.
2.JAR files can be created with any format and directory of your choice; whereas WAR files are created from Servlets. 3.They have a specific format; they have specific directories and files. The WAR files have a WEB-INF directory, WEB-INF/lib directory, WEB-INF/web.xml, and WEB-INF/classes directory.
4.The acronym of “JAR” files is “Java Archive” files; whereas the acronym of “WAR” files is “Web Application Archive” files.
5.The JAR files are packaged with a .jar extension; whereas WAR files are packaged with a .war extension.
6.EJB modules are packaged as JAR files. This module contains an EJB descriptor and Java beans class files; whereas web modules are packaged as WAR files which contain JSP files, Servlet class files, supporting files, GIF, and HTML.
1.The main difference between JAR files and WAR files is that one can package many different things in JAR files. It is most commonly used to package Java classes, but a lot of other things can be packaged as well. However, WAR files are specifically for web applications.
2.JAR files can be created with any format and directory of your choice; whereas WAR files are created from Servlets. 3.They have a specific format; they have specific directories and files. The WAR files have a WEB-INF directory, WEB-INF/lib directory, WEB-INF/web.xml, and WEB-INF/classes directory.
4.The acronym of “JAR” files is “Java Archive” files; whereas the acronym of “WAR” files is “Web Application Archive” files.
5.The JAR files are packaged with a .jar extension; whereas WAR files are packaged with a .war extension.
6.EJB modules are packaged as JAR files. This module contains an EJB descriptor and Java beans class files; whereas web modules are packaged as WAR files which contain JSP files, Servlet class files, supporting files, GIF, and HTML.