48

Where does the Jar file come from? I expected it to be either a part of the JDK or Eclipse. That expectation proved to be wrong.

Nathan
  • 8,093
  • 8
  • 50
  • 76
James Raitsev
  • 92,517
  • 154
  • 335
  • 470

3 Answers3

67

Sun/Oracle is providing a java-ee.jar - which contains only the Java EE APIs and does not contain any method bodies - that you can use to compile against it (from the java.net maven repository):

If you want to execute some Java EE code, you'll need a Java EE application server, they provide an implementation of the Java EE APIs. For example, for Java EE 6, there is GlassFish.

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • How can i add the java-ee dependency in my pom? – Kayser Aug 27 '12 at 12:45
  • 3
    @Kayser: You should typically be adding the dependency as a provided dependency in your POM: ` javax javaee-api 6.0 provided ` or ` javax.j2ee j2ee 1.4 provided ` – Neel Oct 31 '12 at 15:42
8

if you want javaee-api-7.jar, use maven dependency

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>7.0</version>
</dependency>

or you can download from here

nobody
  • 223
  • 4
  • 5
3

Download Glassfish or JBOSS or another Java EE app server. They all have it.

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • 1
    It’s better to include the dependency as suggested in other answers, then you can swap between Glassfish, TomCat, JBoss without having to check your code is compatible. – Christian Dec 12 '17 at 09:00
  • No, it'll be a problem if the app server includes the JAR and there's a conflict. Better yet - don't use Java EE anymore. Go with Spring Boot. It's almost 2018. Java EE is dead. – duffymo Dec 12 '17 at 11:52