Solved

Can not find mail package

Posted on 2011-09-19
2
302 Views
Last Modified: 2013-11-24
Hello experts,

I work on Linux and want to send e-mails with Java code. However, when I compile it, I get

[cat@app07 paypal432]# javac CCBatchDev.java
CCBatchDev.java:17: package javax.mail does not exist
import javax.mail.*;
^
CCBatchDev.java:18: package javax.mail.internet does not exist
import javax.mail.internet.*;

but I already added the dir that contains "activation.jar" and "mail.jar" to classpath. Look at this:

[cat@app07 paypal432]# echo $CLASSPATH
/opt/jdk1.6.0_14/bin:/usr/local/mgpackages

Anybody knows why my code still can't find the mail modules?

Thanks so much.
0
Comment
Question by:davidw88
2 Comments
 

Author Comment

by:davidw88
ID: 36574471
Hi experts,

Any comments?

Thanks.
0
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 125 total points
ID: 36915763
try the following.

set your classpath as given below

/opt/jdk1.6.0_14/bin:/usr/local/mgpackages/activation.jar:/usr/local/mgpackages/mail.jar
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question