Results 1 to 3 of 3
  1. #1
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default javax.mail Query HELP

    Hi all

    I made a GUI based code to send mails using javax.mail api now i made my code in Net Beans and i just made a library of javax.mail and attached it to my project
    Everything is working fine using netbeans

    The problem arises when i create a jar file of it and try to run in other computer there the mail does not send

    The problem is that javax.mail api is not in that PC so how can i add javax.api in that api without manually adding javax.mail in the system path of PC

    This problem is also in my PC too even though i have added the path in system variable path but even then i cant run the jar file

    Help me please

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    the [system] path used by netbeans IDE is likely not the same as the control panel settings environment variable CLASSPATH variable.

    you can set the system environment variable for CLASSPATH to include the location of this mail.jar and restart windows, or the command shell used to launch the applicaiton.

    or you can do this in a batch file to set the class path and then launch your application

    Java Code:
    set CLASSPATH=pathtomail.jar;my.jar
    java -cp %CLASSPATH% package.my.main.Class
    or you can have the external dependent API in the same folder when building the jar file ,specify the manifest entry for class path, see also: Adding Classes to the JAR File's Classpath (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)

  3. #3
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

Similar Threads

  1. problem with sending mail usin javaX.mail api
    By sandeepsai39 in forum New To Java
    Replies: 4
    Last Post: 11-25-2009, 06:37 AM
  2. javax.mail.Transport
    By sharpi03 in forum Advanced Java
    Replies: 5
    Last Post: 10-23-2009, 06:26 PM
  3. javax.mail.SendFailedException: Invalid Addresses;
    By Anju Jose in forum Advanced Java
    Replies: 2
    Last Post: 03-08-2009, 01:29 AM
  4. Replies: 2
    Last Post: 05-05-2008, 07:01 AM
  5. I can't import javax.mail
    By katie in forum New To Java
    Replies: 2
    Last Post: 08-04-2007, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •