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 (e.g. 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 SDK疑问:JAR位置、关系及开发配置详解
本文解答了Java EE SDK中JAR文件位置问题,指出Java EE是Java SE的扩展,开发时只需引用应用服务器库。介绍了如何在IntelliJ中集成应用服务器,无需手动添加到JDK库中。重点在于服务器配置和项目关联,而非JDK库管理。
234

被折叠的 条评论
为什么被折叠?



