是否有Java EE JDK [英] Is there a Java EE JDK

查看:99
本文介绍了是否有Java EE JDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这已被问了一百万次我做了我的功课,但最后一件事我还不完全明白,是否有Java EE JDK?

I know this has been asked a million times and I did do my homework, but the one last thing I don't fully understand is, is there a "Java EE JDK" ?

当我下载SDK时,它会尝试安装很多我不想要的垃圾。所以我做了一些阅读并意识到实际上Java SDK是一组技术上与JDK无关的工具。所以我正在寻找的只是简单的JDK单独下载。

When I download the SDK, it tries to install lots of crap I don't want. So I did some reading and realized that actually the Java SDK is a set of tools technically unrelated to the JDK. So what I am looking for is a clean simple standalone download of the JDK only.

我们知道Java SE JDK一直是可用。但是,我正在开发一个Web应用程序,并对 Java EE特性的一些感兴趣:javax.servlet,javax.validation,javax.persistence和javax.transaction。所以实际上我真正想要的是Java EE JDK。

We know that "Java SE JDK" has always been available from Sun's (now Oracle) website. However, I am developing a web application and interested in some of the Java EE features: javax.servlet, javax.validation, javax.persistence and javax.transaction. So in effect what I'm really looking for is a "Java EE JDK".

我正在使用典型的Maven / Tomcat / Spring / Hibernate设置并且在过去我总是在Maven提供的范围中为Java EE规范的这些部分添加仅API依赖项,即:

I'm using a typical Maven / Tomcat / Spring / Hibernate setup and in the past I've always added API-only dependencies in provided scope in Maven to my project for these parts of the Java EE specification, i.e:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
</dependency>

因此,如果我为我的项目需要的所有Java EE API执行此操作,那么我实际上正在使用Java SE JDK以及一些其他手动声明的Java EE组件。此外,当我指示我的IDE使用Java EE SDK安装附带的JDK时,这些额外的命名空间不可用。

So if I do this for all the Java EE APIs that my project requires, then I am actually using Java SE JDK with some additional manually-declared Java EE components. Furthermore when I direct my IDE to use the JDK that came with the Java EE SDK installation, these additional namespaces aren't available.

换句话说,对于所有意图和目的看来,Java EE SDK下载附带的JDK与我在安装Java SE JDK时获得的JDK相当......如果这是正确的,那么我就不需要安装Java了EE SDK和我可以简单地使用Java(SE)JDK声明我需要的任何Java EE组件作为* -api /提供的依赖关系,如上所述。

In other words, for all intents and purposes it would appear that the JDK that comes with the Java EE SDK download is equivalent to the JDK that I get when I install the "Java SE JDK"... If this is correct then there is no need for me to install the Java EE SDK and I can simply use the Java (SE) JDK declaring any Java EE components that I need as *-api/provided dependencies the way I described above.

所以我的问题是:我上面描述了正确的方法,还是有Java EE JDK这样的东西?即一个JDK,它带有javax.servlet和javax.resources之类的未实现接口等等?如果这样的野兽存在,我会从哪里下载?

So my questions is: is what I describe above the right way to go, or is there such a thing as a "Java EE JDK"? i.e a JDK that comes with the unimplemented interfaces of things like javax.servlet and javax.resources and so on? And if such a beast exists, where would I download it from?

推荐答案

你所问的是我可以得到所有EE组件作为单个下载,没有GlassFish,NetBeans等。

What you're asking is "can I get all the EE components" as a single download without GlassFish, NetBeans, etc.

确切地知道Java EE究竟是什么有用。这是一组有时相关/有时不相关的企业级别组件的规范(无论企业意味着什么:))。例如,servlet-api规范(如前面的答案所示)是Java EE规范的一部分。 JTA(事务API),JPA,Java Mail等也是如此。

Well it's helpful to know exactly what Java EE really is. It's a set of specifications of sometimes related / sometimes unrelated "Enterprise" level components (whatever Enterprise means :)). For example, the servlet-api spec (as indicated by a previous answer) is part of the Java EE spec. So is the JTA (transaction API), JPA, Java Mail, and so on.

有两种类型的EE组件。
1.仅作为接口提供的应用程序服务器或第三方实现它们。例如JTA,JPA,Servlet-API。
2.作为完整参考实现发布的那些。例子是Java-Mail。我无法想到其他人,但会有一些。

There are two types of EE component. 1. Those which are shipped as interfaces only and the application-server or a third party implements them. Examples are JTA, JPA, Servlet-API. 2. Those which are shipped as full reference implementations. Examples are Java-Mail. I can't think of others off top of my head but there will be some.

现在一个完整的应用服务器,如glassfish,附带了一组实现,所以很多时候人们在Glassfish,Websphere等中看到它们,并认为他们需要使用它们。像Tomcat这样的容器不是应用程序服务器,它是一个servlet容器,因此只实现完整Java EE堆栈的子集(仅限servlet所需的部分)。

Now a full application server, such as glassfish, ships with the set of implementations so lots of times people see them inside Glassfish, Websphere etc and think that they need that to use them. A container such as Tomcat is not an application server, it is a servlet-container and thus only implements a subset of the full Java EE stack (the parts that are required for servlets only).

为了获得完整的Java EE接口/实现集,您需要在构建中添加单独的接口或实现。在这种情况下,你只需要知道在哪里找到它们,而这取决于经验。例如,人们倾向于知道JPA是作为Hibernate依赖项的一部分添加的。

In order to get the full set of Java EE interfaces/implementations you would need to add the separate interfaces or implementations to your build. In that case you just "have to know" where to find them, and that comes by experience. People tend to know that JPA is added as part of the Hibernate dependencies for example.

这篇关于是否有Java EE JDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆