Question for distributing a program using Java Mail

J

Justin

I have a program that I have written that utilizes the Java Mail (and
the Activation Framework). I wrote the program in Netbeans 5.5 IDE.
When I build an executable JAR file, a "dist" folder is created.
Inside the folder is a "lib" folder where the compiled libraries
(Activation and Mail) are put. Now, when I go to run the program
through the Jar file, which remains in the dist folder, the program
fails when it tries to use Java Mail. I am still relatively new to
Java, but I am guessing it isn't working because the Java Mail library
comes with some of it's own JAR files that arent copied to the
program's "lib" file. My question is, how do I get the program to
work?

Thanks
 
R

Roedy Green

My question is, how do I get the program to
work?

This is one of the problems with JavaMail. You somehow have to get
the clients to install it. You might find Java Web Start is the way to
fly. It will download and install code for you, and it will download
and install the JavaMail jars too.

see http://mindprod.com/jgloss/javawebstart.html

Perhaps you might use JAWS to just install your JavaMail client
program.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Justin said:
I have a program that I have written that utilizes the Java Mail (and
the Activation Framework). I wrote the program in Netbeans 5.5 IDE.
When I build an executable JAR file, a "dist" folder is created.
Inside the folder is a "lib" folder where the compiled libraries
(Activation and Mail) are put. Now, when I go to run the program
through the Jar file, which remains in the dist folder, the program
fails when it tries to use Java Mail. I am still relatively new to
Java, but I am guessing it isn't working because the Java Mail library
comes with some of it's own JAR files that arent copied to the
program's "lib" file. My question is, how do I get the program to
work?

Put a Class-Path directive in the manifest in your jar file that
point to the other two jar files.

Then distribute the 3 jar files together and it should work fine.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top