Import javax.mail not found

Hello,
I am new to Java Mail. I wanted to test my first programme. When I compile, I get this errors.
package javax.mail not found in import and so on. I have set my classpath to so
set classpath = %classpath%;C:\j2sdk1.4.0\lib\mail.jar;C:\j2sdk1.4.0\lib\activation.jar
I included the mail.jar,smtp.jar and activation.jar in the lib directory of my jdk e.g c:\j2sdk1.4.0\lib\ "the jar file".
Can any one tell me what I am missing here?
Thanks
James

the easiest way to do this is to put
activation.jar
mail.jar          
mailapi.jar     
imap.jar     
smtp.jar          
pop3.jar
into the virtual machine directory C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext
or the lib\ext directory of whatever virtual machine you are using
and put coppies of them in JDK
C:\j2sdk1.4.0-beta3\jre\lib\ext
or jre\lib\ext
of whatever JDK you are using
this way they are found automaticaly
no need for classpath

Similar Messages

  • Import javax.mail not found problem

    I have downloaded the most recent mail.jar and activation.jar files and have created a library w/in JDev called javamail and have added these jars to that library. I have also included this library in my ViewController Project. The problem I am having is that the following imports statements are not found by JDev:
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    When I open up the mail.jar I can find all of these classes, so why are these imports not being recongnized?
    I have also tried import javax.mail.*; to include everthing and this does not work either.
    Does anyone have any suggestions on how to trouble shoot this issue?

    Try to add the J2EE library - which is predefined in JDeveloper- to your project's libraries.
    Worked for me.

  • Package javax.mail not found in import.

    hi,
    i am trying to develop a mail application using jsp, i have jaf1.0.1 and javamail API and the application was working fine on weblogic but when i tried to do the same thing on Apache server the Package javax.mail not found in import. is occuring,
    What could be the problem can any one explain...
    Thanks

    I think you have not placed mail.jar and activation.jar files in the /jre/lib/ext directory. Just place the mail.jar and activation.jar files in the jdk's /jre/lib/ext directory and check out. This will work for you.
    Rkanthj

  • Import javax.crypto not found error

    Hi,
    I have just installed the JDK1.7 on a windows machine.
    Whenever I try to compile my module, I get an error on the import javax.crypto line. It tells me that it can't the javax\Crypto\Cipher.class.
    I have the jdk installed on d:\glassfish3 and am pointing the classpath to d:\glassfish3\jdk7 (also tried d:\glassfish3\jdk7\jre as well) with no luck.
    Any help would be greatly appreciated.
    Thanks,
    Drew Nathanson
    Technical Synergy, Inc.

    Thanks. Maybe I should explain a little better.
    I am using JBuilder 2006 to my IDE. This environment requires that you put in the path to the JRE/JDK.
    I have uninstalled and downloaded the jdk again and this time i'm getting a strange error:
    "test.java": cannot access javax.crypto.Cipher; bad class file: D:\Program Files\Java\jre7\lib\jce.jar\javax\crypto\Cipher.class, class file has wrong version 51.0, should be 49.0, Please remove or make sure it appears in the correct subdirectory of the classpath. at line 19, column 21
    Now this is strange because i'm using the right library.
    Is there something that I'm missing here?
    Again, thanks for your help.
    Drew Nathanson

  • Import javax.mail.* problem ...

    I have added the line 'import javax.mail.*;' to the top of my program and got the compiler error 'Package javax.mail not found in import'. I have since read through loads of similar problems on this forum and have tried the following :-
    Downloaded jaf-1_0_2.zip and javamail-1_3.zip from the Sun site, unzipped them, and placed mail.jar and activation.jar onto my PC. I have added these .jar files into my classpath and re-booted my PC. However, I STILL get the same compiler message and it's doing my head in! Do I somehow need to add the .jar files into my project? Or am I just being very thick? I am developing using Visual Cafe 3.0. I am using JDK 1.2.2.
    I am quite new to this and I have not even started to code the e-mailing method yet - I'm simply trying to get the import working.
    Any help would be much appreciated and would mean I can sleep tonight!
    Thanks in advance.

    Hi,
    check where you have placed the mail.jar file.....give the proper classpath where you have placed the jar file....
    check this out....it will compile...

  • Import javax.mail package does not exists

    Hi,
    when i tried to compile the source code for email using jdk1.3.1, it compiled fine. but when i tried to compile using jdk1.4.., it had the following errors such as
    import javax.mail package does not exists,
    import javax.mail.internet package does not exists
    package javax.activation does not exist
    Is it because of the jdk version problem???
    Pls help me

    I have the same problem with javax.ejb
    Now i've downloaded and installed the j2ee and set my classpath to the j2ee.jar. I've had to make a new path cause i'm running XP.
    This doesn't work.
    to compile it in Jcreator or JBuilder I can make it work by adding this package (j2ee.jar) in the project settings - required libraries.
    But I have to do this for every project again and again.
    I can make it work but i thougt the classpath would be enough ??
    Bassegio

  • Package javax.swing not found in import!

    I recently installed JDK 1.3.1_02 on WinNT4.0 and I cannot compile javax
    packages without getting the following error:
    Package javax.swing not found in import
    I've tried every combination of modifying the CLASSPATH system variable
    I can think of. I have no problem compiling java packages but not
    javax packages. I followed the installation instructions to the letter.
    What am I missing? Surely someone is running the same version of
    the JDK I am on WinNT 4.0.

    Thanks again!!! I had an older version of javac running on my system any time I ran
    outside of the bin where the latest javac was installed. I removed the older version
    of the jdk and now I can compile from any directory. I really appreciate the help,
    I was wracking my brain.
    By the way, -version is not a valid flag for javac.exe, although it is for java.exe.
    signed,
    grateful in cyberspace

  • Problem importing javax.mail.*

    Hey,
    I just installed the Java JDK 6 update 16 (windows platform). I am not able to compile a sample code that used the javax.mail package. I am not able to get past the
    import javax.mail.*;
    line. The compiles says "package javax.mail does not exist"
    I tried separately installing the JavaMail 1.4.2 API and setting the classpath to the mail.jar file as suggested in the readme.txt for this API, but I still get the same problem. Anyone has any suggestions?
    Thanks!

    Hi! I see you've answered similar problems before - but nothing seems to be working for me.
    My OS is Vista. I installed the JDK 6 update 16 just yesterday. I'm using the command line javac.
    I can see the mail.jar file in this folder: C:\Sun\SDK\lib\ and I've set the classpath using : set classpath=%classpath%;C:\Sun\SDK\lib\mail.jar
    When I type set classpath at the prompt, I can see that the classpath has been set correctly.
    Please help!

  • Package javax.ejb not found error

    Hi there,
    I've downloaded j2se 1.4 and j2ee 1.3.1 and installed it on Windows XP. I set the environment variables as described. When I compile a .java file that imports the javax.ejb.* package, then I get an error "package javax.ejb not found". I feel like an idiot and I know it's something to do with the environment variables. (or just XP, most likely)
    Thanks in advance
    Hoenner

    How are you compiling your source? If you're using an IDE then you should edit your project classpath to include the j2ee.jar file (it'll probably be in the lib directory of your J2EE installation).
    If you're doing it from the command line then type in SET CLASSPATH, look at the classpath it returns and check that it includes the j2ee.jar file.
    Hope this helps.

  • Trying to import javax.mail.*

    hi,
    I need to make a sort of webmail program for school, i understand most of the things I've read so far about it but when i actually try to program and import javax.mail.* and javax.mail.internet.* Together (the compiler we have to use) doesn't recognise these import
    any help would be appreciated because i'm dying to get started :)

    Hi,
    You need to have java mail jar files in your classpath.
    They are available for download at http://java.sun.com/products/javamail/downloads/index.html
    -Amol

  • Package javax.servlet not found error

    package javax.servlet not found error. how it can be solved.
    plz help this is my first servlet program.
    vipin

    You need a jar file that has in it the javax.servlet.* classes
    It should be distributed with your servlet/jsp server.
    It can normally be found in a /lib directory under the installation.
    Some examples:
    Tomcat4: install_dir\common\lib\servlet.jar
    Tomcat5: install_dir\common\lib\servlet-api.jar; install_dir\common\lib\jsp-api.jar
    J2sdkee: install_dir/lib/j2ee.jar
    You need to include this jar file in your classpath when you compile any servlet.

  • Javax.servlets not found

    when i try to import the javax.servlet's, it is not found... any idea where i can go toget that? i downloaded the seperate elipse for J2EE and tried it on there, and i also tried it on the eclipse for regular java developers.
    thanks
    update: it turns out that eclipse has a # of requirements that it needs to get the WTP, i'll appreciate any assistance in directing me toward the files.
    Edited by: ixxalnxxi on Jun 17, 2008 3:30 AM

    No, you need to specify the application server in the eclipse project. Then it will take its libraries in the build path.
    You may find this tutorial useful, you can just skip the JSF part if you aren't planning to use it: [http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html].

  • Javax packages not found for J2SDK 1.5.0

    Hi,
    I am very new to Java SDK. I just installed J2SDK 1.5.0 beta 2 and installed it on my RedHat 9.0 box with root permission at /usr/local/(java-home)/
    I can compile simple applications which do not import extension packages. However, when I try to compile an application importing javax.swing.* , I get the below error message:
    Craps.java:9: Can't find default package `javax.swing'. Check the CLASSPATH environment variable and the access to the archives
    Craps.java:11: Superclass `JApplet' of class `Craps' not found.
    public class Craps extends JApplet implements ActionListener {
    The code of this application is correct, coz I can compile and execute it in Windows.
    Can anybody help me with this problem?
    Thanks!

    Hi Joni,
    Thank you for the reply!
    I've solved the problem with your inspiration of the ClASSPATH. This is for the reference of those who may encounter the same problem as me.
    I installed Redhat 9.0 with default settings and those bundled packages (could be normal to many Linux newbies like me :) There is a default java compiler installed, I guess, and it's bundled with gcc. So when I tried to compile my .java files, the javac comand from j2sdk was not involked. Instead, it's the default-installed java compiler that correspended to my command. I guess this is why no matter what I changed in the .bash_profile in my home directory, the j2sdk command javac had not executed.
    After I uninstalled this one, and add j2sdk/bin into my CLASSPATH, everything works fine now.
    Btw, I found out this problem by simply typing "javac" in the terminal and read the help suggestions that followed.

  • Javax.ejb NOT FOUND

    Hi anyone,
    I am creating an Entity Bean, and I have imported javax.ejb.EntityBean. I get an error during compilation
    " javax.ejb.EntityBean package not found"
    I am using jdk1.2.2 I even tried with jdk1.3.
    My query is:
    Q1. Which is the jar in jdk which provides class files for javax.ejb.EntityBean package ?
    thanks
    vikas

    It is in j2ee_home\lib directory. Include this in the classpath.
    -Siva

  • CMS Import error: archive not found

    Hi experts,
    trying to import components under Consolidation tab in CMS I get this error:
    Feb 7, 2011 4:12:26 PM   Error  : error during loading of propagation request Exc=com.sap.cms.tcs.interfaces.exceptions.TCSFileNotFoundException: archive not found: D:\usr\sap\trans\EPS\in
    \CMStarvosNWD/CMS/archives/sap.comSAP-SHRWEBNWD_EAMM1DEV_D~6 / D:\usr\sap\trans\EPS\in\CMStarvosNWD/CMS/archives/sap.com#SAP-SHRWEB#NWD_EAMM1DEV_D#6
    archive not found: CMS/archives/sap.comSAP-SHRWEBNWD_EAMM1DEV_D~6
    Unfortunately all the *.pra files were deleted under CMS\archives. 
    Ho can I restore these archives?? Or what can I do? What are the *.pra achives for?
    Best Regards
    Mirko

    Hi Mirko,
    I think the error comes not due to the pra files, but due to the missing sca files. Can you please try to recreate them in the way we have discussed? Assembly always takes the changes from cons/active, there's no way to change on this behaviour, i.e. there's nothing to be configured thisregarding. After import into cons a force activation takes place (i.e. in cons there's no need to do an explicit activation, the changes gets reflected after import automatically into cons/inactive as well as in cons/active)
    Best Regards,
    Ervin

Maybe you are looking for

  • Checkboxes in BI Publisher not showing up for all reports

    Hi everyone, I followed the instructions (uploading fonts, checking the checkbox font property e.t.c) for displaying checkboxes (without the diamond shape) in my BI Publisher reports. It worked for 1 report and still does. Unfortunately the new repor

  • Theme images missing in 6.1

    when i select and click a theme.....it opens but without images... Kindly help... thanks

  • Intelligent Agent 8.1.6 and Enterprise Manager 8.1.7

    I installed the Oracle 8.1.7 Enterprise Manager on Windows 2000 and want to connect to a database on a Dec-Unix system. My Problem: On the Unix-Server there is installed an 8.1.7 Database, but the 8.1.6 Intelligent Agent. Is it possible, and how can

  • CS4 FW Internal Error

    Has anyone a solution to the Fireworks not launching/Internal Error issue? I've read a good bit of threads and no single solution has worked.

  • Logic x and 9

    I have logic 9 on My mac if i install logic x ont he same mac is logic 9 and logic x be two different  program Mellonman....