-
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
-
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
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)
-