eclipse 如何在eclipse项目中添加Javamail API源代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16212026/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:24:53  来源:igfitidea点击:

How to add Javamail API source code in eclipse project

eclipsejavamail

提问by Lucifer

what are the steps to add source code of Javamail API in my project so that i can see javamail classes easily by clicking on its class from my project. I am using eclipse

在我的项目中添加 Javamail API 的源代码的步骤是什么,以便我可以通过单击我的项目中的类轻松查看 javamail 类。我正在使用日食

回答by greenkode

Welcome to Stack overflow.

欢迎使用堆栈溢出。

There are basically two methods of doing this.

基本上有两种方法可以做到这一点。

Method 1: The 'Easy' way.

方法 1:“简单”的方法。

You use Maven, If your project is a maven project. include the dependency for javamail. Right click on your project and select Maven > Download Sourcesenter image description herethis should basically download the Source files for all your dependencies.

您使用 Maven,如果您的项目是 Maven 项目。包括对 javamail 的依赖。右键单击您的项目并选择Maven > Download Sources在此处输入图片说明这基本上应该下载所有依赖项的源文件。

Method 2: The 'Hard' Way

方法 2:“硬”方式

Go to this linkand download your Javamail 1.5 jar. and This linkto download your Javamail 1.5 source jar. Next step, Right click on your Project, select Properties. Select Java Build Path, Click the Libraries Taband Click Add external Jars. enter image description here

转到此链接并下载您的 Javamail 1.5 jar。和此链接可下载您的 Javamail 1.5 源 jar。下一步,右键单击您的项目,选择Properties。选择Java Build Path,单击Libraries 选项卡并单击Add external Jars在此处输入图片说明

Browse to the location of your library and Add it. Expand the javamail library. Click Source attachmentand click the Editbutton. enter image description hereBrowse to the location of your source zip file and add it.

浏览到您图书馆的位置并添加它。展开 javamail 库。单击源附件,然后单击编辑按钮。 在此处输入图片说明浏览到源 zip 文件的位置并添加它。

You should now be able to see your Source javadocs, Control Clicking on a Javamail Class, should take you to the source Class as well.

您现在应该能够看到您的源 javadoc,控制单击 Javamail 类,也应该将您带到源类。