问题设置javamail的类路径? [英] problem setting classpath of javamail?
问题描述
我下载了 java邮件,因为我想运行有头文件:
I downloaded java mail because i wanted to run the code that had header files :
import javax.mail.*;
import javax.mail.internet.*
但是即使设置了类路径后,我也无法运行该代码.
But even after setting the class path i am unable to run that code.
java邮件中包含的jar文件是:
The jar files included in java mail are :
- mail.jar
- dsn.jar
- imap.jar
- mailapi.jar
- pop3.jar
- smtp.jar
我编辑了我的classpath变量,最后是:
I edited my classpath variable and finally it was :
C:\ Program Files \ Java \ jdk1.7.0 \ lib; C:\ Program Files \ Java \ javamail-1.4.4 \ mail.jar; C:\ Program Files \ Java \ java \ javamail-1.4. 4 \ lib;.;
第一个jar文件位于单独的目录中,其余的jar文件位于一个目录中.
The first jar file is in a seperate directory and the remaining jar files are in one directory.
如果类路径设置错误,请告诉错误. (我已经选择了正确的目录)
If the class path is set wrong , then please tell the mistake. (i have taken the correct directories)
如果类路径没有问题,那是什么问题?
If there is no problem with the class path then what is the problem ?
推荐答案
您需要在classpath中分别指定每个jar,用jar指定目录将无效.
You need to specify each single jar separately in classpath, specifying directory with jars won't work.
这篇关于问题设置javamail的类路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!