Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with Running msgsend demo of JavaMail  RSS feed

 
David Eilloc
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I pretty new to Java and that so if I ask a stupid question please bear with me.
I have jdk1.3.1 running and it appears to working corectly (running NT with the only classpath set to 'jdk\bin\'). I have downloaded JavaMail1.2 and JAF1.0.1 and extracted them, placing all the JAR out of the zip files in my '\jdk\jre\lib\ext\' directory.
After that I went to the 'demo' directory in Javamail and compiled the msgsend.java file.
When I try and run the msgsend class file (with the -o & -M switches included), I get the following error:
'Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Message
I have looked about for a day now and cannot find an answer to my problem. Can someon please help me?
Thanks in advance
David Eilloc
 
raghavender rao
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i found a solution for u .hope it will solve ur problem.
kindly read the below text and follow according to the instructions.....
if u still find any problems do mail me back...
Requirements
------------
Note that the JavaMail API requires the JavaBeans(TM) Activation
Framework package to be installed as well. Download the latest version
of the JavaBeans Activation Framework from
http://java.sun.com/beans/glasgow/jaf.html
and install it in a suitable location.

Installation
------------
Solaris
-------
1. Unzip the javamail-1_2.zip archive. (you may have already done this)
2. Set your CLASSPATH to include the "mail.jar" file obtained from
the download, as well as the current directory.
Assuming you unzipped javamail-1_2.zip in /u/me/download/ the
following would work:
export CLASSPATH=$CLASSPATH:/u/me/download/javamail-1.2/mail.jar:.
Also include the "activation.jar" file that you obtained from
downloading the Java Activation Framework, in your CLASSPATH.
i.e,
export CLASSPATH=$CLASSPATH:/u/me/download/activation/activation.jar

3. Go to the demo directory
4. Compile any demo using your java compiler. For example:
javac msgshow.java
5. Run the demo. The '-' option lists the required and optional
command-line options to successfully run any demo. For example:
java msgshow -

lists the available options. And
java msgshow -T imap -H <mailserver> -U <username> -P <passwd> -f INBOX 5

uses the IMAP protocol to display message number 5 from your INBOX.
(Additional instructions on how to run the simple mail reader demo
and servlet demo are provided in demo/client/README.txt and
demo/servlet/README.txt, respectively.)

Windows NT/95
-------------
1. Unzip the javamail-1_2.zip archive. (you may have already done this)
2. Set your CLASSPATH to include the "mail.jar" file obtained from
the download, as well as the current directory.
Assuming you unzipped javamail-1_2.zip in c:\download the
following would work:

set CLASSPATH=%CLASSPATH%;c:\download\javamail-1.2\mail.jar;.
Also include the "activation.jar" file that you obtained from
downloading the JavaBeans Activation Framework, in your CLASSPATH.
set CLASSPATH=%CLASSPATH%;c:\download\activation\activation.jar

3. Go to the demo directory
4. Compile any demo using your java compiler. For example:
javac msgshow.java
5. Run the demo. The '-' option lists the required and optional
command-line options to successfully run any demo. For example:
java msgshow -
lists the available options. And
java msgshow -T imap -H <mailserver> -U <username> -P <passwd> -f INBOX 5

uses the IMAP protocol to display message number 5 from your INBOX.

(Additional instructions on how to run the simple mail reader demo
and servlet demo are provided in demo/client/README.txt and
demo/servlet/README.txt, respectively.)

Problems?
---------
Our web page at http://java.sun.com/products/javamail has a pointer
to the FAQ that includes information on protocols supported,
installation problems, etc. You'll also find information on how to
subscribe to our discussion-list or announcement-list for announcements
of future JavaMail API releases.
See the NOTES.txt file for information on how to report bugs.
Enjoy!
The JavaMail API Team

------------------
Regards
Rao
 
raghavender rao
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i found a solution for u .hope it will solve ur problem.
kindly read the below text and follow according to the instructions.....and set the CLASSPATH
if u still find any problems do mail me back...
Requirements
------------
Note that the JavaMail API requires the JavaBeans(TM) Activation
Framework package to be installed as well. Download the latest version
of the JavaBeans Activation Framework from
http://java.sun.com/beans/glasgow/jaf.html
and install it in a suitable location.

Installation
------------
Solaris
-------
1. Unzip the javamail-1_2.zip archive. (you may have already done this)
2. Set your CLASSPATH to include the "mail.jar" file obtained from
the download, as well as the current directory.
Assuming you unzipped javamail-1_2.zip in /u/me/download/ the
following would work:
export CLASSPATH=$CLASSPATH:/u/me/download/javamail-1.2/mail.jar:.
Also include the "activation.jar" file that you obtained from
downloading the Java Activation Framework, in your CLASSPATH.
i.e,
export CLASSPATH=$CLASSPATH:/u/me/download/activation/activation.jar

3. Go to the demo directory
4. Compile any demo using your java compiler. For example:
javac msgshow.java
5. Run the demo. The '-' option lists the required and optional
command-line options to successfully run any demo. For example:
java msgshow -

lists the available options. And
java msgshow -T imap -H <mailserver> -U <username> -P <passwd> -f INBOX 5

uses the IMAP protocol to display message number 5 from your INBOX.
(Additional instructions on how to run the simple mail reader demo
and servlet demo are provided in demo/client/README.txt and
demo/servlet/README.txt, respectively.)

Windows NT/95
-------------
1. Unzip the javamail-1_2.zip archive. (you may have already done this)
2. Set your CLASSPATH to include the "mail.jar" file obtained from
the download, as well as the current directory.
Assuming you unzipped javamail-1_2.zip in c:\download the
following would work:

set CLASSPATH=%CLASSPATH%;c:\download\javamail-1.2\mail.jar;.
Also include the "activation.jar" file that you obtained from
downloading the JavaBeans Activation Framework, in your CLASSPATH.
set CLASSPATH=%CLASSPATH%;c:\download\activation\activation.jar

3. Go to the demo directory
4. Compile any demo using your java compiler. For example:
javac msgshow.java
5. Run the demo. The '-' option lists the required and optional
command-line options to successfully run any demo. For example:
java msgshow -
lists the available options. And
java msgshow -T imap -H <mailserver> -U <username> -P <passwd> -f INBOX 5

uses the IMAP protocol to display message number 5 from your INBOX.

(Additional instructions on how to run the simple mail reader demo
and servlet demo are provided in demo/client/README.txt and
demo/servlet/README.txt, respectively.)

Problems?
---------
Our web page at http://java.sun.com/products/javamail has a pointer
to the FAQ that includes information on protocols supported,
installation problems, etc. You'll also find information on how to
subscribe to our discussion-list or announcement-list for announcements
of future JavaMail API releases.
See the NOTES.txt file for information on how to report bugs.
Enjoy!
The JavaMail API Team

------------------
Regards
Rao
 
David Eilloc
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry raghavender rao

I think I forgot to mention in my first post that I have installed the JAF and added it to my Classpath. Thanks for replying.
Still getting the 'Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Message' error.
The tic-tac-toe works to test the JDK but this first demo for JAvaMail will not.
I have placed my activation.jar in the lib folder of the JDK's JRE and the JAvaMail mail.jar in it's
own folder within the jdk. All are referenced correctly and my CLASSPATH is set as:
PATH=".;C:\jdk\lib;C:\jdk\javamail-1.2\mail.jar;C:\jdk\jre\lib;C:\jdk\jre\lib\ext\activation.jar"
I have also had it as
PATH=".;C:\jdk\bin;C:\jdk\javamail-1.2\mail.jar;C:\jdk\jre\lib;C:\jdk\jre\lib\ext\activation.jar"
Any other suggestions would be greatly appreciated
Thanks
David Eilloc
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!