dcsimg
JavaMail - Why does it have to be so difficult
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   angus_Mac
Posted On:   Sunday, June 27, 2004 01:36 PM

Folks, I have the following setup: 1. j2sdk-1_4_1_05-windows-i586.zip installed and working with other applications 2. CLASSPATH = C:APIactivation.jar;C:APImail.jar I have set the class path using XP System Properties>Env Variables. And the CLASSPATH is exactly as shown above. When I try to execute the msgsendsample.java I get the following error: "Exception in thread "main" java.lang.NoClassDefFoundError: msgsendsample" although the application compiles ok. I have searched and search this forum for a reply and this is my last resort to post a question. I have tried moving the jar files to the JRE bin/ext   More>>

Folks,


I have the following setup:


1. j2sdk-1_4_1_05-windows-i586.zip installed and working with other applications


2. CLASSPATH = C:APIactivation.jar;C:APImail.jar


I have set the class path using XP System Properties>Env Variables. And the CLASSPATH is exactly as shown above.


When I try to execute the msgsendsample.java I get the following error:


"Exception in thread "main" java.lang.NoClassDefFoundError: msgsendsample"


although the application compiles ok.



I have searched and search this forum for a reply and this is my last resort to post a question. I have tried moving the jar files to the JRE bin/ext. I have tried putting them in the same directory, I have tried changing the import order etc..etc..


Can anyone recommend a solution to this as this is getting very frustrating. I guess the issue is with activation.jar, however I cannot be sure. One thing for sure this is an issue that many face


PLEASE PLEASE HELP


Regards


Angus

   <<Less

Re: JavaMail - Why does it have to be so difficult

Posted By:   devendra_khoker  
Posted On:   Tuesday, July 27, 2004 10:13 AM

Mr Simon Ablett is right if u're building a jar.

If u're attemting to run it at command prompt, u'll have to include the folder where your class file is into your classpath ie if your class file is placed in default package (no package statements) and u've swithced to your class directory at cmd prompt, add current directory "." to your classpath using the command:

SET CLASSPATH=%CLASSPATH%;.;     Please note the last dot-semicolon.



hope this helps...

Re: JavaMail - Why does it have to be so difficult

Posted By:   Simon_Ablett  
Posted On:   Monday, June 28, 2004 06:27 AM

You need to include the directory where the class files for your program lie (i.e. the directory where 'mysendsample.class' is) or the actual jar file if you are building it into a jar.

Regards.
About | Sitemap | Contact