Skip to main content



      Home
Home » Newcomers » Newcomers » export jars with referenced jars
export jars with referenced jars [message #271147] Wed, 27 May 2009 12:27 Go to next message
Eclipse UserFriend
Originally posted by: faraz.fallahi.googlemail.com

Hi.
I need to export my Eclipse Java project as a jar and I want to include
the referenced libraries. Ive read that eclipse doesnt support this. But
today i found a post that says eclipse 3.5 is able to do this. if so,how
does it work. ive tried eclipse 3.5 and the steps for exporting a java
project as a jar seem to be similarto prior versions.
Does anybody know anything about this ? Or is there another easy way to
do this?

greez
Re: export jars with referenced jars [message #271149 is a reply to message #271147] Wed, 27 May 2009 12:40 Go to previous messageGo to next message
Eclipse UserFriend
You can try exporting as a "runnable" jar. This packs all the
dependencies together.

Another option is to export the project as a plugin (it has to be a
plugin project first). By creating your jars as plugins, you get to
take advantage of all the PDE (plugin development environment) tooling.

cheers,
ian

exquisitus wrote:
> Hi.
> I need to export my Eclipse Java project as a jar and I want to include
> the referenced libraries. Ive read that eclipse doesnt support this. But
> today i found a post that says eclipse 3.5 is able to do this. if so,how
> does it work. ive tried eclipse 3.5 and the steps for exporting a java
> project as a jar seem to be similarto prior versions.
> Does anybody know anything about this ? Or is there another easy way to
> do this?
>
> greez


--
R. Ian Bull | EclipseSource Victoria | +1-888-679-8753
http://eclipsesource.com | http://twitter.com/eclipsesource
Re: export jars with referenced jars [message #271159 is a reply to message #271149] Wed, 27 May 2009 13:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: faraz.fallahi.googlemail.com

doesnt a runnable jar require a main methode? i think ive tried it and
failed.
do u mean to extract the jars and take the bincode into a plugin?and
then import the plugin instead of the jar?

greez

Ian Bull schrieb:
> You can try exporting as a "runnable" jar. This packs all the
> dependencies together.
>
> Another option is to export the project as a plugin (it has to be a
> plugin project first). By creating your jars as plugins, you get to
> take advantage of all the PDE (plugin development environment) tooling.
>
> cheers,
> ian
>
> exquisitus wrote:
>> Hi.
>> I need to export my Eclipse Java project as a jar and I want to
>> include the referenced libraries. Ive read that eclipse doesnt support
>> this. But today i found a post that says eclipse 3.5 is able to do
>> this. if so,how does it work. ive tried eclipse 3.5 and the steps for
>> exporting a java project as a jar seem to be similarto prior versions.
>> Does anybody know anything about this ? Or is there another easy way
>> to do this?
>>
>> greez
>
>
Re: export jars with referenced jars [message #271164 is a reply to message #271159] Wed, 27 May 2009 13:18 Go to previous messageGo to next message
Eclipse UserFriend
I don't know if the runnable jar requires a main. It might.

For the plugin option, I was thinking
File -> export -> deployable plugins

This should create a jar with the required jars inside. I don't know if
java handle nested jars. I know the equinox runtime does.

cheers,
ian

exquisitus wrote:
>
> doesnt a runnable jar require a main methode? i think ive tried it and
> failed.
> do u mean to extract the jars and take the bincode into a plugin?and
> then import the plugin instead of the jar?
>
> greez
>
> Ian Bull schrieb:
>> You can try exporting as a "runnable" jar. This packs all the
>> dependencies together.
>>
>> Another option is to export the project as a plugin (it has to be a
>> plugin project first). By creating your jars as plugins, you get to
>> take advantage of all the PDE (plugin development environment) tooling.
>>
>> cheers,
>> ian
>>
>> exquisitus wrote:
>>> Hi.
>>> I need to export my Eclipse Java project as a jar and I want to
>>> include the referenced libraries. Ive read that eclipse doesnt
>>> support this. But today i found a post that says eclipse 3.5 is able
>>> to do this. if so,how does it work. ive tried eclipse 3.5 and the
>>> steps for exporting a java project as a jar seem to be similarto
>>> prior versions.
>>> Does anybody know anything about this ? Or is there another easy way
>>> to do this?
>>>
>>> greez
>>
>>


--
R. Ian Bull | EclipseSource Victoria | +1-888-679-8753
http://eclipsesource.com | http://twitter.com/eclipsesource
Re: export jars with referenced jars [message #271167 is a reply to message #271164] Wed, 27 May 2009 13:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: faraz.fallahi.googlemail.com

thx a lot.
i'll try tomorow

Ian Bull schrieb:
> I don't know if the runnable jar requires a main. It might.
>
> For the plugin option, I was thinking
> File -> export -> deployable plugins
>
> This should create a jar with the required jars inside. I don't know if
> java handle nested jars. I know the equinox runtime does.
>
> cheers,
> ian
>
> exquisitus wrote:
>>
>> doesnt a runnable jar require a main methode? i think ive tried it and
>> failed.
>> do u mean to extract the jars and take the bincode into a plugin?and
>> then import the plugin instead of the jar?
>>
>> greez
>>
>> Ian Bull schrieb:
>>> You can try exporting as a "runnable" jar. This packs all the
>>> dependencies together.
>>>
>>> Another option is to export the project as a plugin (it has to be a
>>> plugin project first). By creating your jars as plugins, you get to
>>> take advantage of all the PDE (plugin development environment) tooling.
>>>
>>> cheers,
>>> ian
>>>
>>> exquisitus wrote:
>>>> Hi.
>>>> I need to export my Eclipse Java project as a jar and I want to
>>>> include the referenced libraries. Ive read that eclipse doesnt
>>>> support this. But today i found a post that says eclipse 3.5 is able
>>>> to do this. if so,how does it work. ive tried eclipse 3.5 and the
>>>> steps for exporting a java project as a jar seem to be similarto
>>>> prior versions.
>>>> Does anybody know anything about this ? Or is there another easy way
>>>> to do this?
>>>>
>>>> greez
>>>
>>>
>
>
Re: export jars with referenced jars [message #271191 is a reply to message #271147] Wed, 27 May 2009 22:15 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

exquisitus wrote:
> Hi.
> I need to export my Eclipse Java project as a jar and I want to include
> the referenced libraries. Ive read that eclipse doesnt support this. But
> today i found a post that says eclipse 3.5 is able to do this. if so,how
> does it work. ive tried eclipse 3.5 and the steps for exporting a java
> project as a jar seem to be similarto prior versions.
> Does anybody know anything about this ? Or is there another easy way to
> do this?

Java in general does not support nesting JARs inside other JARs; they
can't be included on the classpath. This is a limitation of Java, not
Eclipse specifically.

The most common approach is to package things up and include a script
for setting up the runtime classpath to include all necessary JARs. If
you're dealing with an application server (like Tomcat, Jetty, JBoss,
WebLogic, WebSphere, etc) then your app needs to be packaged as a WAR or
EAR, a different topic altogether.

Hope this helps,
Eric
Previous Topic:Problem with ANT build in Eclipse
Next Topic:default proxy setup in plugin_customization.ini
Goto Forum:
  


Current Time: Sat Mar 15 01:23:41 EDT 2025

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

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

Back to the top