Link to home
Start Free TrialLog in
Avatar of Madhu_A
Madhu_AFlag for United States of America

asked on

How to package Jar files to reuse in several projects, in Eclipse?

Eclipse question:
Hi,  I have a project called common in my Eclipse wbench. This project has some source files
and some jars from various locations - each one added manually from everywhere.

Now there are some other projects in the wbench and they need the same jar files. I do not want
to repeat adding the numerous jar files again and again for each project.

Questions:
1)Is there a way to package all jar files to one Big jar file and use this jar file reference in other projects.
or
2)I will try referencing the common project by other projects but perhaps some project do need need to refer to
common project but just need the same jar files.
3)Any Ant script which could go fetch the jar files, so that I can use this script to import the jar files
in which ever project I may need?


Eclipse 3.2.1
Thanks!
ASKER CERTIFIED SOLUTION
Avatar of sanjooz
sanjooz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Madhu_A

ASKER

Hi, I went through the menu and was able to figure out how to create a User library and include it in which ever project I may want. Great!

Sub questions:
When I create a new user library it gives me an option to check which says - "added to the boot class - system library" - what does this mean?

Also does the same logic apply to creating classpaths. Like create certain class paths and use them selectively to which ever project one may want.
Avatar of sanjooz
sanjooz

Well AFAIK, there is no such thing as CREATING a classpath. Classpath specifies the location of classes and jars that you may need to run your program. When you are creating a library you are in essence adding those jar files and classes to the classpath itself.
Avatar of Madhu_A

ASKER

In Eclipse there is :
window > preferences > java > build path > class libraries
as well along with the build path option where I added the user library. So I was wondering if a similar common set of class paths could be created for several projects to use.
Yes, I think you can definitely do that.
Avatar of Madhu_A

ASKER

Ok, thanks.