Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Export package and include jar's
Export package and include jar's [message #987022] Thu, 22 November 2012 23:54 Go to next message
Eclipse UserFriend
He everybody,

I have long and painfully googled but to no avail.

Is there any possibility of exporting my package as archive and have
there automatically included jar's that I reference in the source code
in a way that when someone else imports the package the build path will
contain those jar's?

I mean without having to add them manually to the build path after the
import.

Thanks a lot
jaro
Re: Export package and include jar's [message #987139 is a reply to message #987022] Fri, 23 November 2012 17:45 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 11/22/2012 04:54 PM, jaro wrote:
> He everybody,
>
> I have long and painfully googled but to no avail.
>
> Is there any possibility of exporting my package as archive and have
> there automatically included jar's that I reference in the source code
> in a way that when someone else imports the package the build path will
> contain those jar's?
>
> I mean without having to add them manually to the build path after the
> import.
>
> Thanks a lot
> jaro

Yes, you can export a single package from your project as a JAR.

The way you're asking this implies that you don't wish then for your
consumer to have to use Eclipse Build Path command to add your JAR to a
project, but that his mere use of the import statement in Java is enough
to accomplish it?

What I've just said is absurd, of course, but it may help you restate
your question in such a way as to make it more clear what you're asking.
Re: Export package and include jar's [message #987199 is a reply to message #987139] Sat, 24 November 2012 12:14 Go to previous messageGo to next message
Jaroslav Urban is currently offline Jaroslav UrbanFriend
Messages: 2
Registered: November 2012
Junior Member
Hi Russell,

What I intend is to export my package as archive file using the wizard
(=source code export) and I wish to have all referenced jar's (whose
functionality I use in my source code) included in that export.
The point is that when someone imports my source code package then the
jar's will be imported as well and automatically added to the build path
of the project / package.

Is this possible?

I know that when the whole project is exported and the jar's are stored
inside the project then I can include them, too, and the build path is
stored in the ".project" file but is such a thing possible at the level
of the source code package? Is it possible to specify the build path in
the "package-info.java"? Because then I could simply copy the jar into
the package folder and specify in the package configuration file that it
belongs into the build path required for that package.

Kind regards
jaro




On 11/23/2012 6:45 PM, Russell Bateman wrote:
> Yes, you can export a single package from your project as a JAR.
>
> The way you're asking this implies that you don't wish then for your
> consumer to have to use Eclipse Build Path command to add your JAR to a
> project, but that his mere use of the import statement in Java is enough
> to accomplish it?
>
> What I've just said is absurd, of course, but it may help you restate
> your question in such a way as to make it more clear what you're asking.
>
Re: Export package and include jar's [message #987243 is a reply to message #987199] Sun, 25 November 2012 04:49 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 11/24/2012 06:14 AM, jaro wrote:
> Hi Russell,
>
> What I intend is to export my package as archive file using the wizard
> (=source code export) and I wish to have all referenced jar's (whose
> functionality I use in my source code) included in that export.
> The point is that when someone imports my source code package then the
> jar's will be imported as well and automatically added to the build path
> of the project / package.
>
> Is this possible?
>
> I know that when the whole project is exported and the jar's are stored
> inside the project then I can include them, too, and the build path is
> stored in the ".project" file but is such a thing possible at the level
> of the source code package? Is it possible to specify the build path in
> the "package-info.java"? Because then I could simply copy the jar into
> the package folder and specify in the package configuration file that it
> belongs into the build path required for that package.
>
> Kind regards
> jaro
>
>
>
>
It sounds like you are talking about exporting the project not a package.

The jar files have to be in your project. They can't be external jar
files. Select them in the export wizard to have them included. Also
make sure that you include the .project and .classpath files. These
contain the project structure and build path.

You should probably make sure that the licenses for the jar files you
are using allow them to be re-distributed. If they don't, you would be
violating the license agreement to include them in your project archive.
Previous Topic:Fix Eclipse Workspace
Next Topic:Vertical border on left side of the editor
Goto Forum:
  


Current Time: Thu Apr 25 10:11:37 GMT 2024

Powered by FUDForum. Page generated in 0.08224 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top