two JARs

B

bob smith

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.
 
K

Knute Johnson

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...
 
K

Knute Johnson

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...
 
R

Roedy Green

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.
 
A

Arved Sandstrom

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
 
M

markspace

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.
 
L

Lew

Roedy said:
bob smith wrote, quoted or indirectly quoted someone who said :

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!
 
R

Roedy Green

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.
 
M

Magnus Warker

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
 
A

Arne Vajhøj

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
 
A

Arne Vajhøj

Roedy said:
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
 
L

Lars Enderin

2013-02-22 17:24, lipska the kat skrev:
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.

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.

What's the deal with your lame nym?
 
A

Arne Vajhøj

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
 
L

Lew

lipska said:
<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?
 
A

Arne Vajhøj

lipska said:
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
 
L

Lars Enderin

2013-02-23 19:46, Martin Gregorie skrev:
Roedy said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top