It's not a secret anymore!
The moose likes Tomcat and the fly likes What is an EAR? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "What is an EAR?" Watch "What is an EAR?" New topic

What is an EAR?

Dan Parsons
Ranch Hand

Joined: May 30, 2007
Posts: 70
I have created and loaded WAR files for Web Applications on my Tomcat 4.1.27 web container.

I have also heard about EAR (Enterprise Archive) file and was wondering if I have the correct definition. On one of my Google searches it says: EAR files contain JAR files and WAR files and another says it is used for packaging one or more modules into a single archive. Module is a web application??
I assume an EAR file can contain many JAR and WAR files wrapped into one file (EAR)? Another way of looking at it is if I have for example 3 WAR files, I can put all 3 in an EAR file?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15083

What you say is correct: an EAR can contain multiple JAR and WAR files. Note that you cannot deploy EAR files on Tomcat. Tomcat is a servlet and JSP container on which you can deploy WAR files. For EAR files, you need a full Java EE container.

See for more information, including a tutorial, on Java EE.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: What is an EAR?
It's not a secret anymore!