Search code examples
javajakarta-eeglassfishnetbeans-8java-ee-7

What is the difference between Java Web Application and Java Enterprise Application


Java EE applications have ejb, business layer and they run on application servers. However, I can create a Java Web Application that includes ejb, and also deploy it to a application server such as Glassfish. In this case, I cannot clearly see the difference. I am using Netbeans IDE, and it looks like I can do anything on Java Web Application. Can you please help me?


Solution

  • Java EE 6/EJB 3.1 introduced the ability to package EJBs in a WAR file (aka web module).

    All earlier versions of Java EE required EJBs to be packaged in an EJB jar which was usually bundled in an enterprise archive (EAR file) along with any associated libraries and web modules.

    Therefore if you are using a modern Java EE server you can build and bundle everything including EJBs into a single WAR file (what you refer to as a Java Web Application) and your life will be much simpler than it used to be.

    The primary reason for building an enterprise EAR file (what you refer to as a Java EE application) today is if you want to share EJBs and other libraries with multiple WAR file deployments.