简体   繁体   English

Java EE SDK的问题

[英]Problems with Java EE SDK

I need help with Java SDKs. 我需要有关Java SDK的帮助。 I have installed Java SE SDK, and I also installed Java EE SDK. 我已经安装了Java SE SDK,并且还安装了Java EE SDK。 However, where are the JARs in the Java EE SDK? 但是,Java EE SDK中的JAR在哪里? Isn't Java EE SDK a superset of Java SE SDK? Java EE SDK不是Java SE SDK的超集吗? Do I need both? 我两个都需要吗?

It doesn't seem that I successfully manages to add all libraries in IntelliJ. 看来我没有成功地设法在IntelliJ中添加所有库。

在此处输入图片说明

Java EE is an abstract API. Java EE是一种抽象 API。 The application server (eg Glassfish, JBoss AS, Tomcat, etc) is the concrete implementation. 应用服务器(例如Glassfish,JBoss AS,Tomcat等)是具体的实现。 The Java EE download link on oracle.com contains the concrete reference implementation of the Java EE API, which happens to be Glassfish. oracle.com上的Java EE下载链接包含Java EE API的具体参考实现,该参考实现恰好是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). 为了针对Java EE API进行开发,您只需要在编译时类路径(在大多数IDE中称为构建路径)中引用应用程序服务器的库。 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. 我不确定IntelliJ,但是在Eclipse中,您需要做的就是将应用程序服务器运行时集成到IDE的服务器配置中,然后将Web项目与该服务器运行时准确地关联到项目属性中。

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. 您无需将其显式添加到JDK库中,甚至更多,它可能会使将来的情况变得更糟,如失去可移植性和可能的​​主要类路径问题。 See also this related (Eclipse-targeted) question: How do I import the javax.servlet API in my Eclipse project? 另请参阅以下相关问题(以Eclipse为目标): 如何在Eclipse项目中导入javax.servlet API?

Java EE is a set of additional APIs/interfaces (and most usually, some implementations of these). Java EE是一组附加的API /接口(通常是这些API /接口的一些实现)。 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. 这些是用于Web应用程序,EJB等的API。如果您具有其他API和实现,则可以使用JDK进行构建。 Most usually a Java EE application will run in an application or web container. 通常,Java EE应用程序将在应用程序或Web容器中运行。

Ref. 参考 Link JDK = Java SE && JDK != Java EE? 链接JDK = Java SE && JDK!= Java EE吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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