Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > two JARs

Reply
Thread Tools

two JARs

 
 
bob smith
Guest
Posts: n/a
 
      02-21-2013
I downloaded the JBox2d library, and I see that there are two JARs: one that ends in the name "sources" and one that doesn't.


jbox2d-library-2.1.2.3-sources.jar
jbox2d-library-2.1.2.3.jar


Can someone help me understand exactly what a seasoned Java programmer would expect to be in each of these JARs? I'm a little confused. I don't know which one to use.



 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      02-21-2013
On 2/21/2013 14:30, bob smith wrote:
> I downloaded the JBox2d library, and I see that there are two JARs:
> one that ends in the name "sources" and one that doesn't.
>
>
> jbox2d-library-2.1.2.3-sources.jar jbox2d-library-2.1.2.3.jar
>
>
> Can someone help me understand exactly what a seasoned Java
> programmer would expect to be in each of these JARs? I'm a little
> confused. I don't know which one to use.
>
>
>


The sources jar is probably just a zip file of the source code. The
other jar file is the compiled class files zipped up.

knute...
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      02-21-2013
On 2/21/2013 14:44, Knute Johnson wrote:
> On 2/21/2013 14:30, bob smith wrote:
>> I downloaded the JBox2d library, and I see that there are two JARs:
>> one that ends in the name "sources" and one that doesn't.
>>
>>
>> jbox2d-library-2.1.2.3-sources.jar jbox2d-library-2.1.2.3.jar
>>
>>
>> Can someone help me understand exactly what a seasoned Java
>> programmer would expect to be in each of these JARs? I'm a little
>> confused. I don't know which one to use.
>>
>>
>>

>
> The sources jar is probably just a zip file of the source code. The
> other jar file is the compiled class files zipped up.
>
> knute...


Do you know how to unjar(zip) them?

k...
 
Reply With Quote
 
Arved Sandstrom
Guest
Posts: n/a
 
      02-21-2013
On 02/21/2013 06:58 PM, Knute Johnson wrote:
> On 2/21/2013 14:44, Knute Johnson wrote:
>> On 2/21/2013 14:30, bob smith wrote:
>>> I downloaded the JBox2d library, and I see that there are two JARs:
>>> one that ends in the name "sources" and one that doesn't.
>>>
>>>
>>> jbox2d-library-2.1.2.3-sources.jar jbox2d-library-2.1.2.3.jar
>>>
>>>
>>> Can someone help me understand exactly what a seasoned Java
>>> programmer would expect to be in each of these JARs? I'm a little
>>> confused. I don't know which one to use.
>>>
>>>
>>>

>>
>> The sources jar is probably just a zip file of the source code. The
>> other jar file is the compiled class files zipped up.
>>
>> knute...

>
> Do you know how to unjar(zip) them?
>
> k...


Why unzip either?

AHS
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      02-21-2013
On Thu, 21 Feb 2013 14:30:20 -0800 (PST), bob smith
<> wrote, quoted or indirectly quoted someone
who said :

>Can someone help me understand exactly what a seasoned Java programmer

would expect to be in each of these JARs? I'm a little confused. I
don't know which one to use.

look inside them with WinZip. Presumably sources contains .java files
and the other .class files.
--
Roedy Green Canadian Mind Products http://mindprod.com
The generation of random numbers is too important to be left to chance.
~ Robert R. Coveyou (born: 1915 died: 1996-02-19 at age: 80)
 
Reply With Quote
 
markspace
Guest
Posts: n/a
 
      02-21-2013
On 2/21/2013 3:12 PM, Arved Sandstrom wrote:

>
> Why unzip either?



Well, for the "sources" one, compilers don't deal with source files
inside a Zip/Jar file.


 
Reply With Quote
 
Arved Sandstrom
Guest
Posts: n/a
 
      02-21-2013
On 02/21/2013 07:34 PM, markspace wrote:
> On 2/21/2013 3:12 PM, Arved Sandstrom wrote:
>
>>
>> Why unzip either?

>
>
> Well, for the "sources" one, compilers don't deal with source files
> inside a Zip/Jar file.
>

No, but that's not typically what they are for - they are, in my
experience, used to inspect source in an IDE, where you attach them as
JARs. Providing the source JARs for a library is better for 3rd party
code inspection than decompiling, which is imperfect.

AHS

 
Reply With Quote
 
markspace
Guest
Posts: n/a
 
      02-22-2013
On 2/21/2013 3:45 PM, Arved Sandstrom wrote:
> On 02/21/2013 07:34 PM, markspace wrote:
>> On 2/21/2013 3:12 PM, Arved Sandstrom wrote:
>>
>>>
>>> Why unzip either?

>>
>>
>> Well, for the "sources" one, compilers don't deal with source files
>> inside a Zip/Jar file.
>>

> No, but that's not typically what they are for - they are, in my
> experience, used to inspect source in an IDE, where you attach them as
> JARs. Providing the source JARs for a library is better for 3rd party
> code inspection than decompiling, which is imperfect.



Oh I see what you're saying. I'm used to Zip files for source
"archives," but since the formats are basically identical I can see Java
programmers using the Jar format for the same thing.



 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      02-22-2013
Roedy Green wrote:
> bob smith wrote, quoted or indirectly quoted someone who said :
>> Can someone help me understand exactly what a seasoned Java programmer
>> would expect to be in each of these JARs? I'm a little confused. I
>> don't know which one to use.


Use them both - the "sources" JAR for the source code and the other one for the actual classes.

In general, a "seasoned Java programmer" would expect "foo-dah-lily.jar" to be suitable for
insertion into the classpath, and "foo-dah-lily-source.jar" (or "...sources.jar") to contain the source
files. Hence the word "source[s]" in the JAR name. Logical, huh?

> look inside them with WinZip. Presumably sources contains .java files
> and the other .class files.


WinZip?

What if he's not using Windows?

Oh, if only there were a cross-platform tool for manipulating, creating, and examing JAR
files. We could call it - let's see now, something that lets you know it's for JAR files -
hmm - for JAR files ... I know! We can call it "jar"!

And Oracle could ship it as a standard part of the JDK!

And they would document it at
http://docs.oracle.com/javase/7/docs...jar/index.html
and related pages!

Then the OP could RTFM!

--
Lew
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      02-22-2013
On Thu, 21 Feb 2013 18:25:37 -0800 (PST), Lew <>
wrote, quoted or indirectly quoted someone who said :

>What if he's not using Windows?


jar.exe is more designed for building jars than exploring them. WinZip
works on jars and lets you explore and selectively extract visually.
Granted it only works Windows, and the latest version 17 is suffering
so badly from irrelevant featuritis I refused to upgrade.

He could also use JarLook http://mindprod.com/products1.html#JARLOOK
if he just want a quick idea of what was in there

Jar files are for all practical purposes also ZIP files, so he could
use the Unix analog of WinZip. I don't think you would find many Unix
users as raw as OP. My guess he is a newbie Windows user.

Why the implication I had never heard of jar.exe? You know that is
not true. Please just give your excellent advice without feeling
compelled to decorate it with a putdown.
--
Roedy Green Canadian Mind Products http://mindprod.com
The generation of random numbers is too important to be left to chance.
~ Robert R. Coveyou (born: 1915 died: 1996-02-19 at age: 80)
 
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
Add *.jars to *.jars possible/recommendend? Eclipse setup for this? Ulf Meinhardt Java 2 02-03-2010 04:11 PM
Same package between two jars aaronfude@gmail.com Java 1 04-13-2007 06:25 PM
Loading image from jars from other jars etc JavaEnquirer Java 2 02-22-2006 03:42 PM
JARs containing JARs alan@engrm.com Java 5 05-19-2005 04:55 PM
exec jars w/dependent jars Ike Java 6 09-24-2004 06:03 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57