mail - Eclipse + Java Project报错
巴扎黑
巴扎黑 2017-04-17 17:42:23
0
3
397

想用Java api发送邮件,导入相关的包:
import javax.mail.*;

然后Eclipse就报错如下错误:

The import javax.mail cannot be resolved

看别人写的代码里也没用专门引入javax.mail相关的包啊,求大神赐教....

巴扎黑
巴扎黑

reply all(3)
洪涛

You need to download the corresponding jar package first, and then "build path-> configure build path-> add external jar" in eclipse

Give me a download address: http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#javamail-1.4.5-oth-JPR

洪涛

Recommended to usecommons-Email,这个Jarbags everywhere

小葫芦

1. It must be useful to others. Maybe those classes have been introduced in the parent class of the class you see.
2. When you imported it, it reported an error because it was not compiled. The reason is that you need to set this:
"build path-> configure build path-> add external jar"
3. Eclipse often cramps, import jar package, recompile the project, refresh the entire project, and it will be fine.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template