?
Solved

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

Posted on 2007-08-03
6
Medium Priority
?
1,320 Views
Last Modified: 2013-12-15
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!
0
Comment
Question by:Madhu_A
  • 3
  • 3
6 Comments
 
LVL 9

Accepted Solution

by:
sanjooz earned 1500 total points
ID: 19631489
If you are using eclipse, you can create a user library. You can add all the jars you want to this user library and then add this library to any project in your workspace. You can also create multiple such user libraries.

To create go to window > preferences > java > build path > User Libraries
0
 

Author Comment

by:Madhu_A
ID: 19631765
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.
0
 
LVL 9

Expert Comment

by:sanjooz
ID: 19634584
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Madhu_A
ID: 19636440
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.
0
 
LVL 9

Expert Comment

by:sanjooz
ID: 19641511
Yes, I think you can definitely do that.
0
 

Author Comment

by:Madhu_A
ID: 19642013
Ok, thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question