简体   繁体   中英

Problems with Java EE SDK

I need help with Java SDKs. I have installed Java SE SDK, and I also installed Java EE SDK. However, where are the JARs in the Java EE SDK? Isn't Java EE SDK a superset of Java SE SDK? Do I need both?

It doesn't seem that I successfully manages to add all libraries in IntelliJ.

在此处输入图片说明

Java EE is an abstract API. The application server (eg Glassfish, JBoss AS, Tomcat, etc) is the concrete implementation. The Java EE download link on oracle.com contains the concrete reference implementation of the Java EE API, which happens to be Glassfish.

In order to develop against the Java EE API, you just need to reference the application server's libraries in the compile time classpath (the build path as it is called in most IDEs). I'm not sure about IntelliJ, but in Eclipse all you need to do is to integrate the application server runtime in the IDE's server configuration and then associate the web project with exactly that server runtime in the project's properties.

You do not need to explicitly add it to the JDK library, even more, it would possibly make things worse in the future as in losing portability and possible major classpath troubles. See also this related (Eclipse-targeted) question: How do I import the javax.servlet API in my Eclipse project?

Java EE is a set of additional APIs/interfaces (and most usually, some implementations of these). These are APIs for web applications, EJBs etc. You can use the JDK to build for this, provided you have the additional APIs and the implementations. Most usually a Java EE application will run in an application or web container.

Ref. Link JDK = Java SE && JDK != Java EE?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM