Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Creating a jar file that contains javamail code

  Asked By: Nancy    Date: Dec 29    Category: Java    Views: 935
  

I have an application that I wish to put into a jar file.
It uses javamail (and java activation framework) files (javax.mail.*
etc.)

I want to jar my program in such a way that MyProg.jar can be given
on its own to someone who doesn't have javamail installed and it will
still work. Can anyone help me out?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Zobebah Mizrachi     Answered On: Dec 29

The jar  file is actually a ziped version of
files.Actually a jar file  can be unzipped using the
winzip utility too!!!!

Make sure that your jar file internally contains a lib
directory. In the lib directory place the
activation.jar and also the mail  jar files.

The expanded structure of the jar file should be

somename.jar
|
|
|-----META-INF
|
|-----lib
|
|
|---activation.jar
|
|
|---mail.jar
|
|
|---pop3.jar (etc)

 
Answer #2    Answered By: Chuong Tran     Answered On: Dec 29

One thing you can do is unjar the javamail  api, and
again package em up, in your final application  jar
file.
But checkout licensing issues.

Second one is place the mail.jar and activation.jar in
the lib folder and use some kind of installshield to
install your application.

There is a posibility of remotely downloading the jar
files, i,e. java  extension framework.

 
Didn't find what you were looking for? Find more on Creating a jar file that contains javamail code Or get search suggestion and latest updates.




Tagged: