Confusion about Java SE and Java EE

自作多情 提交于 2019-12-24 02:38:16

问题


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. 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.

  2. 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?

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


回答1:


Getting Java mail

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)

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

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

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.

Your JDK 1.7 should appear in right pane.



来源:https://stackoverflow.com/questions/12773152/confusion-about-java-se-and-java-ee

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!