Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   two JARs (http://www.velocityreviews.com/forums/t957908-two-jars.html)

bob smith 02-21-2013 10:30 PM

two JARs
 
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.




Knute Johnson 02-21-2013 10:44 PM

Re: two JARs
 
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...

Knute Johnson 02-21-2013 10:58 PM

Re: two JARs
 
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...

Arved Sandstrom 02-21-2013 11:12 PM

Re: two JARs
 
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

Roedy Green 02-21-2013 11:25 PM

Re: two JARs
 
On Thu, 21 Feb 2013 14:30:20 -0800 (PST), bob smith
<bob@coolfone.comze.com> 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)

markspace 02-21-2013 11:34 PM

Re: two JARs
 
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.



Arved Sandstrom 02-21-2013 11:45 PM

Re: two JARs
 
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


markspace 02-22-2013 12:29 AM

Re: two JARs
 
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.




Lew 02-22-2013 02:25 AM

Re: two JARs
 
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

Roedy Green 02-22-2013 07:59 AM

Re: two JARs
 
On Thu, 21 Feb 2013 18:25:37 -0800 (PST), Lew <lewbloch@gmail.com>
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)


All times are GMT. The time now is 08:59 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.