Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: help: a question for creating JAR file

Reply
Thread Tools

Re: help: a question for creating JAR file

 
 
markspace
Guest
Posts: n/a
 
      02-19-2011
On 2/18/2011 5:28 PM, www wrote:

> Is there a smart way to do this? Both in Eclipse or using ANT.



Yes, normally you build this as you add Jar files to your project.

If you start with Apple and Peach, then add abc.efg.Cat and abc.xyz.Dog,
you update your build files at that time. Both the normal build of just
classes and the Jar file should be tested to make sure they both work.

Then if you add a.b.Paw, then do so and test it right away. Leaving
things to the last minute is a sure way to make it a big job.

Most folks have a src/ director where all their files Java files go.
Everything in this directory gets compiled and put into the final Jar
file. So all you should do is drop the new files in there and voila, it
builds and is put into the Jar.

Most folks also keep a library/ for Jar files too, so that the binary
are put on the class path during testing and somehow dealt with in the
final deliverable Jar.

You seem to be implying that there are dependencies in the files
themselves. Well that happens. The right thing to do is to choose Jar
files that document their dependencies. If DogCat.jar also requires
Paw.jar, then it should darn well say so in the documentation.

If instead you get DogCat.jar and it's a mess of unresolved dependencies
and missing documentation, well that's a hint to chuck the thing out and
find a better library.

If these are internally generated files, then you need procedures and
discipline in place so each developer knows how check files into the
repository so that all other developers know how to check them out with
their dependent files. Again, the build/test process should verify that
this was done correctly.

 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      02-19-2011
On 18-02-2011 21:03, www wrote:
> I am sorry. I cannot follow you. All these Java files were developed
> by us in a couple years. Now, we need to give just a small part of our
> code as JAR files to an outside organization since they have heard our
> code is so good. So, it is "last minute" thing. I don't want to wrap
> the whole tree to give them. I want the JAR file as slim as possible.


You digged a hole and now you need to climb up from it.

I don't think there are any good shortcuts.

Best try would be to pack everything in a jar and the apply
an obfuscater/shrinker to that jar file and tell it to remove
unused stuff.

Arne


 
Reply With Quote
 
 
 
 
Daniele Futtorovic
Guest
Posts: n/a
 
      02-19-2011
On 19/02/2011 03:03, www allegedly wrote:
> Now, we need to give just a small part of our
> code as JAR files to an outside organization since they have heard our
> code is so good.


Wow awesome! Hey... uh... could you, maybe, tell me the name of those
guys? I'm asking because I've got this Java library I've written a few
week-ends back. It emulates an x86 processor, but is actually twice as
fast as the actual processor it runs on! Do you think they might be
interested in buying it? It wouldn't come cheap though.

 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      02-19-2011
Please do not top-post.

www wrote:
> I am sorry. I cannot follow you. All these Java files were developed
> by us in a couple years. Now, we need to give just a small part of our
> code as JAR files to an outside organization since they have heard our
> code is so good. So, it is "last minute" thing. I don't want to wrap
> the whole tree to give them. I want the JAR file as slim as possible.


If the code depends on the other class, you have to include the other class.
That *is* "as slim as possible".

If you want to remove dependencies, you have to figure out which ones can be
removed. As soon as you remove something that is actually used, you'll have a
problem running the code.

Tearing out what you think you don't need will have you tearing out your hair.
It's doing the job backwards. Instead, build up from nothing to what you
want. That way you include what you need, not remove what you don't.

--
Lew
Honi soit qui mal y pense.
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      02-19-2011
On 02/19/2011 09:25 AM, www wrote:
> On Feb 18, 10:00 pm, Daniele Futtorovic
> <(E-Mail Removed)> wrote:
>> On 19/02/2011 03:03, www allegedly wrote:
>>
>>> Now, we need to give just a small part of our
>>> code as JAR files to an outside organization since they have heard our
>>> code is so good.

>>
>> Wow awesome! Hey... uh... could you, maybe, tell me the name of those
>> guys? I'm asking because I've got this Java library I've written a few
>> week-ends back. It emulates an x86 processor, but is actually twice as
>> fast as the actual processor it runs on! Do you think they might be
>> interested in buying it? It wouldn't come cheap though.

>
> Sure. It's Apple company. Or, why don't you start your own company and
> in a next few weekends buy Apple company directly?! Just remember to
> let me know your company name.


Based on what you're asking, it's really hard to believe your company's code
is all that good. I wonder how you fooled Apple?

--
Lew
Honi soit qui mal y pense.
 
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
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
how to disassembly a .jar file? how to see what are the classes inside the .jar file? lucy Java 6 09-07-2004 09:54 PM



Advertisments