关于Java SE和Java EE的困惑 [英] Confusion about Java SE and Java EE

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

问题描述

我正在愉快地使用Java SE和Eclipse,但现在我要编写一个发送邮件程序,该程序需要 javax.mail 包。我发现在Java EE中我下载了一个(180MB),我知道Java EE安装需要SE JDK / JRE。因为我在 c:\ java \ _jdk1.7 (不是默认路径)中安装了Java SE,所以我使用 -jc:\ javaa \\ jdk1.7 安装Java EE。我有几个问题。

I am using Java SE with Eclipse happily but now I am going to write a "send mail" program which requires javax.mail package. I found that in Java EE so I downloaded one (180MB) and I know that Java EE installation needs SE JDK/JRE. Because I installed Java SE in c:\java\jdk1.7 (not the default path) I use -j c:\java\jdk1.7 to install Java EE. I have several questions about it.


  1. 我怎样才能让Eclipse加载Java EE包?我应该在Java EE中更改JRE吗?现在Eclipse仍然只知道SE库。

  1. How could I let Eclipse to load the Java EE package? Should I change the JRE in Java EE? Now Eclipse still only know the SE lib.

我们是否有一个包含Java EE API的JDK版本?因为我真的不想在我的电脑上安装两个JRE而且我不需要Glassfish。有人可以告诉我应该下载哪一个吗?

Do we have a JDK version which include APIs from Java EE? Because I really do not want to install two JREs in my computer and I do not need Glassfish. Can some one tell me which one I should download?

Java EE是否有 src.zip API?我找不到它。

Is there src.zip for Java EE api? I cannot find it.


推荐答案

获取Java邮件

Java Mail API technetwork / java / javamail / index-138643.htmlrel =nofollow> Oracle网站
Exctract JARs( mailapi.jar 有所需的 java.mail 包)并放入你的CLASSPATH by:

Download Java Mail API from Oracle website. Exctract the JARs (mailapi.jar has the desired java.mail package) and put in yout CLASSPATH by:

RightClick(project) -> properties -> Java Build Path -> Libraries 
-> add Jars/Add External Jars (depends where you put your JARS)

更新JRE
在日食中,使用如下菜单选项:

Updating the JRE In your eclipse, use the menu options as below:

    window -> preferences->  Java -> Installed JREs -> Add

将路径指定为 c:\ javaa \ jdk1.7 并按照步骤完成。
完成后, JDK 1.7 将出现在前面带有复选框的列表中。选择复选框然后按确定

Give the path as c:\java\jdk1.7 and follow the steps to complete. Once done, JDK 1.7 will appear in the list with checkbox in front. Select the checkbox and press OK.

你应该如果您尚未进行任何项目特定设置,请全部设置。

You should be all set, if you haven't done any project specific settings.

要验证项目特定设置,请按照以下步骤操作:

To verify the project specific settings, follow the steps:

    RightClick(project) -> properties -> Java Build Path -> Libraries.

您的 JDK 1.7 应出现在右侧窗格中。

Your JDK 1.7 should appear in right pane.

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

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