File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes To make an eclipse project self sufficient Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "To make an eclipse project self sufficient" Watch "To make an eclipse project self sufficient" New topic

To make an eclipse project self sufficient

justin smythhe
Ranch Hand

Joined: Jul 06, 2012
Posts: 107
I want to give my project to someone else. I want it to run on her computer
regardless of the version of java she has, or even if she does not have the
the extra jars used by my project. There is an "src" folder with my source code.
There is also "JRE System Library" (JSL) and "Referenced Libraries" (RL).
I manually copied the contents of RL inside a lib folder that i made in my project.
I want to use the jars in lib in my build path. But I dont see the lib folder (or its jars) when
I use the "configure build path" option. How do I add the Jars in that lib folder to build path.

Once that is done, I want to do the same for JSL.

If the above things can be done, then will my program be able to work in a system, even
if it does not have jars installed ?

Anayonkar Shivalkar

Joined: Dec 08, 2010
Posts: 1545

Hello justin smythhe,

In Eclipse, there is an option - create executable jar. Inside that, it asks whether you want to package class files, or required jars, or nothing at all.

If you choose to package required jars, then size of your jar would be quite big, but it will contain a lib folder, inside which, required jars would be copied - and classpath would be accordingly set in manifest file.

However, while doing this with third party jars, make sure that you are not breaking anything legal (i.e. you are packaging only free jars etc. - for it is illegal to deliver non-free third party jars with your application).

I hope this helps.

Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
I agree. Here's the link:
subject: To make an eclipse project self sufficient
It's not a secret anymore!