Solved

Can not find mail package

Posted on 2011-09-19
2
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
null output 3 59
Java 8 to Java 6 8 44
Tagging and Merging on Branch 1 70
Java Inharitance subclass/child extends, reference variable from base/parent class 9 72
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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 …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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:
Suggested Courses

752 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