Solved

Can not find mail package

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 85
best (free) software to access postgres db (java) 1 32
javap bin 2 27
windows explorer path to command prompt 5 30
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

911 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

19 Experts available now in Live!

Get 1:1 Help Now