Topic: 考虑了两天,都没有解决的问题!!!

  Print this page

1.考虑了两天,都没有解决的问题!!! Copy to clipboard
Posted by: magice
Posted on: 2004-10-05 23:51

  我要运行的是一个简单的邮件服务器查看程序,程序头是这么做的:
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import java.util.*;
public class MailTest {
…… ……
书上说要把mail.jar和activation.jar加入到classpath中,
而我的环境变量是:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\bin;
而且我把上面两个文件放到了%JAVA_HOME%\lib中,和%JAVA_HOME%\jre\lib\ext中,编译都没有错误,但是java运行就有错误提示我:
Excetipn in thread "main" java.lang.No ClassDeffoundError: javax/mail/Message
不知道怎么回事情,请大家说说看法~~~~
(mail.jar解压后有javax/mail/Message)

2.Re:考虑了两天,都没有解决的问题!!! [Re: magice] Copy to clipboard
Posted by: floater
Posted on: 2004-10-06 04:15

maybe your java home is pointing to somewhere else.

3.Re:考虑了两天,都没有解决的问题!!! [Re: magice] Copy to clipboard
Posted by: magice
Posted on: 2004-10-06 09:01

my java home is pointing to c:\jdk1.4.2;

4.Re:考虑了两天,都没有解决的问题!!! [Re: magice] Copy to clipboard
Posted by: COWCOW
Posted on: 2004-10-06 09:33

找个IDE调试一下.

5.Re:考虑了两天,都没有解决的问题!!! [Re: magice] Copy to clipboard
Posted by: dorrenchen
Posted on: 2004-10-06 12:43

you have to put the actual two jars into your classpath, like this

.;%JAVA_HOME%\lib;c:/mail.jar;c:/activation.jar

6.Re:考虑了两天,都没有解决的问题!!! [Re: magice] Copy to clipboard
Posted by: magice
Posted on: 2004-10-06 16:36

thanks ! i finally gei it~!~~~~


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923