There are many technical differences between a Jar File, War File and EAR File in JAVA. This tutorial tries to explain some of them:
JAR File:
Jar file (file with a .jar extension) is the normal Java Application archive and intended to hold generic libraries of Java classes, resources, auxiliary files, etc It is added in the classpath of Java Programms and are used in running java applications. For eg. ojdbc5.jar is used to connect to Oracle Databases
WAR File:
War files (files with a .war extension) are intended to contain complete Web applications. In this context, a Web application is defined as a single group of files, classes, resources, .jar files that can be packaged and accessed as one servlet context. War file consists of Servlet class files,JSP Files,supporting files, GIF and HTML files
EAR File:
All above files(.jar and .war) are packaged as JAR file with .ear ( enterprise archive) extension and deployed into Application Server. an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web application.