Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > newbie-question: make executable jar from eclipse-project

Reply
Thread Tools

newbie-question: make executable jar from eclipse-project

 
 
Javier Vazquez
Guest
Posts: n/a
 
      03-09-2005
How do I get an executable jar out of an eclipse-project?

I've read it should be possible using an Ant-script. Is there any other
possibility? What's this Ant-Thing about and does anyone know a good
introduction into this subject?
 
Reply With Quote
 
 
 
 
Paul van Rossem
Guest
Posts: n/a
 
      03-09-2005
On 09-03-2005 16:40, Javier Vazquez wrote:
> How do I get an executable jar out of an eclipse-project?
>
> I've read it should be possible using an Ant-script. Is there any other
> possibility? What's this Ant-Thing about and does anyone know a good
> introduction into this subject?


Just use menu File->Export...

Paul.
 
Reply With Quote
 
 
 
 
Javier Vazquez
Guest
Posts: n/a
 
      03-09-2005
Paul van Rossem schrieb:
> On 09-03-2005 16:40, Javier Vazquez wrote:
>
>> How do I get an executable jar out of an eclipse-project?
>> <snip>

>
> Just use menu File->Export...
>


Let's say it's a JMF-Project, will the imported JMF-Libraries be
exported into the jar as well? I can't expect a normal user to have JMF
installed on his PC...
 
Reply With Quote
 
Paul van Rossem
Guest
Posts: n/a
 
      03-09-2005
On 09-03-2005 17:11, Javier Vazquez wrote:
> Paul van Rossem schrieb:
>
>> On 09-03-2005 16:40, Javier Vazquez wrote:
>>
>>> How do I get an executable jar out of an eclipse-project?
>>> <snip>

>>
>>
>> Just use menu File->Export...
>>

>
> Let's say it's a JMF-Project, will the imported JMF-Libraries be
> exported into the jar as well? I can't expect a normal user to have JMF
> installed on his PC...

If JMF is in a jar, you should install that together with your own jar
for the user.

There is some utility that you could use to put it all together into a
single jar (google for net.sf.fjep.fatjar). However I don't recommend
that. I don't know if it will work for JMF, I don't know if the JMF
licence allows it, and it doesn't improve the portability of your code.
Usually it 's more profitable to just deliver the required jars with
your own jar.

You said it yourself, you can't expect a normal user to have JMF
installed on his PC, so how can you expect him/her to have Java
installed on his/her PC? It's not that difficult to use an installer
that does it all for the user!

Paul.
 
Reply With Quote
 
Oscar kind
Guest
Posts: n/a
 
      03-09-2005
Javier Vazquez <news@_donotspam_.a-team.ch_donotspam> wrote:
>
> Let's say it's a JMF-Project, will the imported JMF-Libraries be
> exported into the jar as well? I can't expect a normal user to have JMF
> installed on his PC...


No. There are several ways to solve this:

1. Unpack the libraries and repack them in you .jar file.
This generally is a bad idea, because of several reasons:
- Licencing. Using a (L)GPL'ed library requires you to use the same
licence for your work. For commercial licences, note that this means
"reverse engineering", even though it's just unpacking, and is
generally prohibited.
- It's difficult to replace a library with a different version
(you doin't expect to need this though)

2. Use "Class-Path" headers in your manifest
This works fine, but requires you to distribute the libraries alongside
your application. They must be referenced from a location relative to
your application.

3. Require the user to have the libraries installed as extensions.
Apart from the fact that you stated you don't expect a user to do this,
it also means you're inviting version problems: all applications must
use the same version of the library. With option 2 the library version
to use can be managed per application.


IMHO, the second option to be the best.


--
Oscar Kind http://home.hccnet.nl/okind/
Software Developer for contact information, see website

PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2
 
Reply With Quote
 
news t-online
Guest
Posts: n/a
 
      03-09-2005

"Paul van Rossem" <(E-Mail Removed)> schrieb im Newsbeitrag
news:422f498e$0$43090$(E-Mail Removed)4all.nl...
> On 09-03-2005 17:11, Javier Vazquez wrote:
>> Paul van Rossem schrieb:
>>
>>> On 09-03-2005 16:40, Javier Vazquez wrote:
>>>
>>>> How do I get an executable jar out of an eclipse-project?
>>>> <snip>
>>>
>>>
>>> Just use menu File->Export...
>>>

>>
>> Let's say it's a JMF-Project, will the imported JMF-Libraries be exported
>> into the jar as well? I can't expect a normal user to have JMF installed
>> on his PC...

> If JMF is in a jar, you should install that together with your own jar for
> the user.
>
> There is some utility that you could use to put it all together into a
> single jar (google for net.sf.fjep.fatjar). However I don't recommend
> that. I don't know if it will work for JMF, I don't know if the JMF
> licence allows it, and it doesn't improve the portability of your code.
> Usually it 's more profitable to just deliver the required jars with your
> own jar.
>
> You said it yourself, you can't expect a normal user to have JMF installed
> on his PC, so how can you expect him/her to have Java installed on his/her
> PC? It's not that difficult to use an installer that does it all for the
> user!
>
> Paul.


The Fat-Jar Eclipse-Plugin ( http://fjep.sourceforge.net/ ) also supports
the "One-Jar" option. With this option enabled, the referenced jars are
included as whole (no unzipping and rezipping). So there are no license
problems.

Best regards,

feri


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running an Executable Before Executable JAR Jason Cavett Java 8 05-16-2007 07:14 PM
java -cp a.jar -jar b.jar => Works on Windows, not on Debian cyberco Java 4 02-14-2006 06:27 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters XML 0 01-05-2005 10:59 PM



Advertisments