two JARs

Discussion in 'Java' started by bob smith, Feb 21, 2013.

  1. bob smith

    bob smith Guest

    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.
     
    bob smith, Feb 21, 2013
    #1
    1. Advertising

  2. 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, Feb 21, 2013
    #2
    1. Advertising

  3. 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...
     
    Knute Johnson, Feb 21, 2013
    #3
  4. 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
     
    Arved Sandstrom, Feb 21, 2013
    #4
  5. bob smith

    Roedy Green Guest

    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)
     
    Roedy Green, Feb 21, 2013
    #5
  6. bob smith

    markspace Guest

    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.
     
    markspace, Feb 21, 2013
    #6
  7. 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
     
    Arved Sandstrom, Feb 21, 2013
    #7
  8. bob smith

    markspace Guest

    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.
     
    markspace, Feb 22, 2013
    #8
  9. bob smith

    Lew Guest

    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" 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/technotes/guides/jar/index.html
    and related pages!

    Then the OP could RTFM!

    --
    Lew
     
    Lew, Feb 22, 2013
    #9
  10. bob smith

    Roedy Green Guest

    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)
     
    Roedy Green, Feb 22, 2013
    #10
  11. On 02/22/2013 08:59 AM, Roedy Green wrote:
    > 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.


    You can do both build and explore jars with the jar command on both
    platforms.

    I believe that you want to argue for having a GUI for exploration.

    > 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 t file.jar | less -S

    Magnus

    --
    This is Unix-Land. In quiet nights, you can hear the Windows machines
    reboot.
     
    Magnus Warker, Feb 22, 2013
    #11
  12. bob smith

    Arne Vajhøj Guest

    On 2/22/2013 2:59 AM, Roedy Green wrote:
    > 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.


    No need to use WinZip for any recent Windows version.

    Windows/file explorer understands zip format!

    Arne
     
    Arne Vajhøj, Feb 22, 2013
    #12
  13. bob smith

    Arne Vajhøj Guest

    On 2/22/2013 4:24 AM, lipska the kat wrote:
    > On 22/02/13 02:25, Lew wrote:
    >> Roedy Green wrote:
    >>> bob smith wrote, quoted or indirectly quoted someone who said :

    >
    > [snip]
    >
    >>
    >> And they would document it at
    >> http://docs.oracle.com/javase/7/docs/technotes/guides/jar/index.html
    >> and related pages!
    >>
    >> Then the OP could RTFM!

    >
    > <rant>
    >
    > Will you STFU with the RTFM
    >
    > Why is it that you feel you need to insert this piece of bullcrap into
    > almost every reply. People come here for help, not everyone is as
    > knowledgeable about Java as you you claim to be. Besides, if everyone
    > RTFM as you suggest there would be nobody for you to whine at.
    >
    > If you don't like a post the DON'T REPLY it's so simple even you should
    > be able to understand that one.


    In general it is better to learn people how to solve problem
    (by reading the documentation) than by explaining the specific
    solution.

    There are at least one meaning of F in RTFM where I don't see
    a problem using that acronym.

    Arne
     
    Arne Vajhøj, Feb 22, 2013
    #13
  14. bob smith

    Lars Enderin Guest

    2013-02-22 17:24, lipska the kat skrev:
    > On 22/02/13 15:56, Arne Vajhøj wrote:
    >> On 2/22/2013 4:24 AM, lipska the kat wrote:
    >>> On 22/02/13 02:25, Lew wrote:
    >>>> Roedy Green wrote:

    >
    > [snip]
    >
    >>>
    >>> If you don't like a post the DON'T REPLY it's so simple even you should
    >>> be able to understand that one.

    >>
    >> In general it is better to learn people how to solve problem
    >> (by reading the documentation) than by explaining the specific
    >> solution.

    >
    > It's quite amazing how certain people in this group pounce on newbies
    > and pompously correct their English yet when old hands mess up the
    > silence is deafening.


    Was that directed at Arne? Did he pounce on newbies or correct their
    English here?

    > Because I'm in a much nicer frame of mind that I was this morning allow
    > me to respectfully correct your English .. no don't bother too thank me,
    > really, I'm pleased to do it.
    >
    > .... it is better to *teach* people how to solve [a] problem ...


    In Scandinavian languages such as Danish the same word is used for learn
    and teach.

    >> There are at least one meaning of F in RTFM where I don't see
    >> a problem using that acronym.


    In Scandinavian languages there is no longer any difference between the
    singular and the plural form of a verb. Arne seems to have a blind spot
    there. He also often uses an adjective where an adverb is required.
    Otherwise his English is fine, I think.

    > there *is* at least one value for F in RTFM where ...
    >
    > Oh REALLY, and which version do you think Bloch is espousing.
    >
    > What is the point of lurking in this group if all you do is berate


    I don't think Lew and Arne are lurking in this group, and they make good
    contributions.

    > people for asking questions ... what question would *not* elicit a
    > response of RTFM. I'd be interested to know ... really, fascinated in
    > fact. What magnificent pearl of wisdom are you reluctant to cast before
    > the proletarian swine in c.l.j.p that cannot be gleaned from Reading The
    > Friendly Manual. In fact why bother to answer any question, why not set
    > up an auto-responder that simply responds to *every* post to c.l.j.p
    > with a simple RTFM.
    >
    > FFS


    You're over-reacting and using foul abbreviations.

    > lipska


    What's the deal with your lame nym?



    --
    Lars Enderin
     
    Lars Enderin, Feb 22, 2013
    #14
  15. bob smith

    Arne Vajhøj Guest

    On 2/22/2013 11:24 AM, lipska the kat wrote:
    > On 22/02/13 15:56, Arne Vajhøj wrote:
    >> On 2/22/2013 4:24 AM, lipska the kat wrote:
    >>> On 22/02/13 02:25, Lew wrote:
    >>>> Roedy Green wrote:

    >
    > [snip]
    >
    >>>
    >>> If you don't like a post the DON'T REPLY it's so simple even you should
    >>> be able to understand that one.

    >>
    >> In general it is better to learn people how to solve problem
    >> (by reading the documentation) than by explaining the specific
    >> solution.


    >> There are at least one meaning of F in RTFM where I don't see
    >> a problem using that acronym.


    > Oh REALLY, and which version do you think Bloch is espousing.


    I don't know.

    And I would not criticize his language based on guesses on what
    he meant.

    > What is the point of lurking in this group if all you do is berate
    > people for asking questions


    People lurking does not berate people by definition.

    And since of all the people in this (sub)thread then you are the
    only one that may fit the description of lurking you may be best
    qualified to answer the question yourself.

    > ... what question would *not* elicit a
    > response of RTFM. I'd be interested to know ... really, fascinated in
    > fact.


    Most questions would not be answered by a link to the docs and a RTFM.

    If it were so then one would be a perfect Java developer by
    learning JLS, Java API and few more documents.

    That is unfortunately not the case. Java development is much more
    complex and difficult than just learning what code compiles and
    what its semantics are.

    All the most difficult/interesting questions "what is the best way
    to ...", "why did they chose to ...", "any good recommendations
    for ..." can not be answered by RTFM.

    I would be tempted to say that if a question can be answered with
    RTFM then the question should probably have been asked in cljh
    instead of cljp.

    But given that the poster most likely don't know if the question is
    a RTFM question or not, then that rule has no practical significance.

    > What magnificent pearl of wisdom are you reluctant to cast before
    > the proletarian swine in c.l.j.p that cannot be gleaned from Reading The
    > Friendly Manual. In fact why bother to answer any question, why not set
    > up an auto-responder that simply responds to *every* post to c.l.j.p
    > with a simple RTFM.


    If you can code a bot that reads questions posted to cljh, analyze
    the text and reply with RTFM *and* a link to the specific section in
    TFM, then I think you should do so.

    I would not hold my breath though ...

    Arne
     
    Arne Vajhøj, Feb 22, 2013
    #15
  16. bob smith

    Lew Guest

    lipska the kat wrote:
    > Lew wrote:
    >> Then the OP could RTFM!

    > <rant>
    > Will you STFU with the RTFM


    Why, do you think it's a bad idea to RTFM?

    > Why is it that you feel you need to insert this piece of bullcrap into


    Because it's the single most empowering piece of advice they can follow. Duh.

    > almost every reply. People come here for help, not everyone is as
    > knowledgeable about Java as you you claim to be. Besides, if everyone


    I don't claim to be knowledgeable about Java. Where did you get that?

    I provide answers that help. RTFM, and the link thereto, is helpful.

    > RTFM as you suggest there would be nobody for you to whine at.


    Are you saying that everyone RTFM and gaining the knowledge they need
    is bad?

    > If you don't like a post the DON'T REPLY it's so simple even you should
    > be able to understand that one.
    > </rant>


    What evidence do you have that I don't like any post here?

    > Bloch apologists beware. I'm just in the mood for it today %-(


    This is an engineering forum. Information here isn't about mood, it's about
    solutions. I RTFM all the time. Don't you?

    --
    Lew
     
    Lew, Feb 22, 2013
    #16
  17. bob smith

    Arne Vajhøj Guest

    On 2/22/2013 2:47 PM, lipska the kat wrote:
    > On 22/02/13 19:15, Lew wrote:
    >> lipska the kat wrote:
    >>> Lew wrote:

    > [snip]
    >
    >>
    >> This is an engineering forum. Information here isn't about mood, it's
    >> about
    >> solutions. I RTFM all the time. Don't you?

    >
    > Of course, anyone that engineers software does but here's the thing, I
    > don't need to be *told* to RTFM.


    If you ask a question that is in TFM, then ...

    > If you know anything about education,
    > if you've had any experience of passing knowledge to other people you
    > will know that you can learn from the rawest interested beginner. I've
    > done my time as a technical instructor and I can tell you from
    > experience that some of the most profound insights into software design
    > and development can come from beginners, they may be incomplete, they
    > may be naive but they can really make you *think*, about your ideas,
    > about your [bad] habits, about your very core beliefs and understanding.


    Interesting thought.

    But not very applicable to the question about what is in two specific
    jar files.

    > How many potential sources of inspiration have not posted to c.l.j.p
    > because all they can see is some herbert telling them to RTFM.


    If they are afraid to post because they fear to get a reply with
    a link to the specific documentation that solves their problem and
    the RTFM acronym, then they are somewhat oversensitive.

    > It doesn't matter if someone asks a naive question, I will continue to
    > answer questions where I can because every time I answer one it makes me
    > think, and learn and look at things from a different perspective... I
    > like thinking, not least because "I think therefore I am"


    Now you are not known for answering questions but more for whining
    about the tone in other peoples posts.

    Arne
     
    Arne Vajhøj, Feb 22, 2013
    #17
  18. bob smith

    Lew Guest

    lipska the kat wrote:
    > capiche ?


    It's spelled «capisce».

    Second-person singular verb form.

    --
    Lew
     
    Lew, Feb 23, 2013
    #18
  19. bob smith

    Lew Guest

    On Saturday, February 23, 2013 12:03:04 PM UTC-8, lipska the kat wrote:
    > On 23/02/13 19:36, Lew wrote:
    >
    > > lipska the kat wrote:

    >
    > >> capiche ?

    >
    > >

    >
    > > It's spelled �capisce�.

    >
    > >

    >
    > > Second-person singular verb form.

    >
    >
    >
    > http://en.wiktionary.org/wiki/capiche
    >
    >
    >
    > First person RTFM


    Thank you.

    --
    Lew
     
    Lew, Feb 23, 2013
    #19
  20. bob smith

    Lars Enderin Guest

    2013-02-23 19:46, Martin Gregorie skrev:
    > On Thu, 21 Feb 2013 18:25:37 -0800, Lew wrote:
    >
    >> 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" 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?
    >>

    > In Linux (and most unices, so also BSD - but I don't know what OS X does)
    > you can use the 'unzip' command line utility as well as 'jar' to test the
    > jar file, list its contents or extract files from it.
    >
    > Alternatively, in most Linuxes, clicking on the .jar file in the File
    > Manager window will start an Archive Manager so you can review, extract
    > and/or view the contents of files in the archive. In Fedora that is
    > Xarchiver and the file associations default to using it open jar files.
    >


    Emacs is also capable of handling file archives, and is freely available
    for Linux, Unix, Windows, etc.

    --
    Lars Enderin
     
    Lars Enderin, Feb 23, 2013
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ike
    Replies:
    6
    Views:
    1,060
    Andrew Thompson
    Sep 24, 2004
  2. Replies:
    5
    Views:
    9,041
  3. JavaEnquirer
    Replies:
    2
    Views:
    523
    JavaEnquirer
    Feb 22, 2006
  4. Replies:
    1
    Views:
    1,310
    Tom Hawtin
    Apr 13, 2007
  5. Ulf Meinhardt
    Replies:
    2
    Views:
    1,405
Loading...

Share This Page