Why can't libraries work outside the application server environment?
Actually, they can. Most libraries can be directly used autonomously (in Java SE) or included in .war (almost always Tomcat). Some parts of Java EE, such as JPA, have explicit sections in their respective specifications that tell how they should work and be used in Java SE.
In any case, this is not so much the application server environment as such, which is at stake here, but the presence of all other libraries and the integration code that combines them.
Because of this, annotations will be checked only once for all of your classes, and not for each library (EJB, JPA, etc.) performing this scan again and again. Also, because of this, CDI annotations can be applied to EJB beans, and JPA entity administrators can be introduced into them.
Why do I need something massive, like JBoss, just to compile simple code to send email?
There are several errors in this question:
- To compile you only need an ATM ATM, which is below 1 MB for a web profile and just over 1 MB for a full profile.
- To start, you obviously need an implementation, but "massive" exaggerates everything. For example, OpenJDK is about 75 MB, and TomEE (a web profile implementation containing email support) is only 25 MB. Even GlassFish (full profile implementation) is only 53 MB.
- Mail works fine with Java SE (and therefore with Tomcat) using standalone mail.jar and activation.jar .
Why are Java EE libraries not “standard” and included in the regular JVM and / or SDK download?
To some extent, Java EE was one of the first attempts to split an already massive JDK into pieces that are easier to manage and load. People already complain that graphic classes (AWT, Swing) and applets are inside the JRE when all they do is run some commands on a headless server. And then you also want to include all Java EE libraries in the standard JDK?
With the final version of modularity support, we will only have a small basic JRE with many things that can be installed separately as packages. Perhaps one day, many or even all of the classes that now make up Java EE will also be like that. Time will tell.
Why are there so many Java EE offers when in fact there are only two main variations of standard Java (Oracle JVM / SDK | OpenJDK JVM / JDK)?
There are more than two options for Java SE. There is at least the IBM JDK, the previous BEA (the JRocket, which merges into Oracle / Sun due to the acquisition), various other open source implementations, and many implementations for embedded use.
The reason that Java SE and EE is a specification is because many vendors and organizations can implement it and thus encourage competition and reduce the risk of vendor blocking.
This really is no different from C and C ++ compilers, where you have many competing offers, as well as all adhering to the C ++ standard.
Why the Java EE library version is not in sync with the standard Java library versions (Java EE 6 and Java 7)
Java EE is built on Java SE, so it lags behind. Versions really match. Java EE 5 requires Java SE 5. Java EE 6 requires Java SE 6 and so on. That is, basically, when Java SE X is current, Java EE X-1 is current.