Are the JavaEE libraries in the JDK?

1

I have a JavaEE code that was delivered to me and I am trying to make it run to create a module from there, among the several libraries that are being imported are the following:

import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

I am not recognizing the javax package, and I understand that this package is clearly JavaEE, I do not have too much time working with JavaEE, what happens? JavaEE apis do not come in the JDK? None of these libraries are recognized by the IDE, I'm using Eclipse, and I have JDK 6 and 7, I've already tried both of them and they do not recognize me. I am using the Weblogic server 11gR1 and WebLogic 12c to program.

    
asked by Ricardo Gabriel 01.10.2017 в 20:55
source

2 answers

1

The short answer is that the libraries you need are part of your application server, or servlet containter (Weblogic) in your case.

You must have a folder, probably lib, with the jar.

You must add those jar to your class path, but do not export them as part of your project.

    
answered by 01.10.2017 / 21:54
source
4

Java EE refers to Java Enterprise Edition, which is composed of a set of standards, as indicated in the official Oracle page . To see the specifications that Java EE 8 covers, you can visit this site

When a specification is mentioned, it can be translated technically into a set of interfaces that you can use in your application to obtain a particular functionality. Some examples of the specifications that are part of Java EE are: Servlets, JSP, JPA, JSF, JAX-WS, JAX-RS, EJB, CDI, JCache, among others.

The community provides a reference implementation, which is composed of several frameworks that provide an implementation of each specification. For example, the current reference implementation is Glassfish 5 . This implementation is free and your source code can be found at github . In this site indicates the frameworks you use for its implementation, not directly, that can be reviewed in the link from the column RI (reference implementation). For example, Java Persistence API here is implemented with EclipseLink.

It should be noted that application servers implement a specific version of Java EE. For example, Wildfly 11 supports / implements Java EE 7. That is, Wildfly 11 provides implementations for Servlets, JSP, JPA, JSF and the other specifications that make up Java EE 7. It does not mean that you must use the same frameworks / classes of the reference implementation, that is, Glassfish. An example is JPA, which Glassfish implements with EclipseLink (as previously mentioned) while Wildfly uses Hibernate. Behold, there are differences in performance between application servers.

With this base, it should be noted that if you want to use Java EE powers, you must create a project that runs on an application server. For this, you will have to download an application server, to your preference.

Some free application servers:

  • Glassfish
  • Wildfly
  • TomEE
  • Payara

Some paid application servers:

  • Oracle Weblogic
  • IBM Websphere Liberty
answered by 01.10.2017 в 21:26