Solved

Can not find mail package

Posted on 2011-09-19
2
292 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 20

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now