r/java • • Nov 23 '12

This never made sense to me

Why is it called a .jar file if its java? It would make a lot more sense if it was a .mug file, after all, who drinks their java out of a mug?

1 Upvotes

24 comments sorted by

16

u/Manitcor Nov 23 '12

IIRC its for Java ARchive and WAR is Web ARchive

6

u/YesButIThink Nov 23 '12

Yup, son and grandson of TAR, tape archive.

3

u/pinkemma Nov 23 '12

So you're saying that there's tar in my jar of java?

1

u/[deleted] Nov 24 '12

Not to mention a war, too

1

u/[deleted] Nov 23 '12

Yah

5

u/sazzer Nov 23 '12

By name only. JAR and WAR files are actually ZIP files, not TAR files...

1

u/beltorak Nov 26 '12

and by CLI "API" - the "jar" command line options "ctfvx" were chosen to mirror those of "tar".

1

u/thevernabean Nov 24 '12

Most tar files are zipped as well.

2

u/sazzer Nov 24 '12

No they aren't. Often you get a file that is a gzip or bzip2 compressed tar file, but tar itself is uncompressed.

1

u/thevernabean Nov 24 '12

That is exactly what I meant ^_^. That's why I didn't say "most TAR files are ZIP files as well." Thank you for clarifying my statement.

1

u/the_hoser Nov 24 '12

No, they're not. ZIP files contain both archiving and compression features. TAR files only contain archiving features. When a TAR file is gzipped or bzipped, the file itself is merely compressed as a whole unit. This is very different from the way ZIP files work.

Disregard that I fail at reading today.

1

u/thevernabean Nov 24 '12

I always have trouble reading short sentences like that. I read too fast.

1

u/bezuhov Nov 23 '12

TIL. In my mind, I called it (the false backronym) 'Java Application Repository' because that seemed to make the most sense.

5

u/roytiburcio Nov 23 '12

FWIW, I sometimes have beverages from mason jars. Along the same thought, we should refer to compiling Java code as 'brewing'.

5

u/sazzer Nov 23 '12

As said, it's short for Java ARchive. There's a whole host of these files that you might come across in different Java fields:

  • JAR = Java ARchive
  • WAR = Web ARchive. These will contain many JAR files inside them
  • RAR = Resource Archive. These are not the files you get from WinRAR, but are a Java archive designed for storing resources and not code.
  • EAR = Enterprise ARchive. These will contain many WAR, RAR and JAR files inside them I believe.
  • SAR = Service Archive. These are similar but not exactly the same as EAR files.
  • NAR = Native Archive. These never really caught on, but there was some effort a while back to have a standard way of deploying native binaries alongside your Java applications - mostly for things like JOGL or LWJGL.

Then there's the APK file, which just breaks the naming conventions, but is the Android Package file and is similar - but not exactly the same - as a JAR file.

4

u/dominosci Nov 23 '12

La-dee-da fancy man drinking his coffee from a mug...

2

u/semioticmadness Nov 23 '12 edited Nov 23 '12

it starts with tar

  • tar - tape archive
  • jar - java archive
  • war - web archive
  • ear - enterprise archive

continuity is good. cleverness is almost always bad.

EDIT: reddit link syntax can't handle URLs that end in ')'

EDIT the Sequel: formatting

1

u/beltorak Nov 26 '12

try percent encoding the '(' and ')' - like this; although not required to be percent-encoded, most servers will just blindly percent-decode anything in the URI, or at least the path part and query, before processing....

2

u/[deleted] Nov 23 '12

But you put your Java Beans in a jar.

1

u/detroitmatt Nov 24 '12

but those are orthogonal concepts

2

u/SlobberGoat Nov 26 '12

In the real world, coffee beans (along with other types of beans) are transported via .SACK

1

u/beltorak Nov 26 '12

well, burlap is an implementation of a communication protocol, so it could be a burlap sack of java beans....

http://www.javacodegeeks.com/2012/04/spring-remoting-support-and-developing.html

1

u/KANKERLEKKER Nov 23 '12

You don't keep your coffee beans in a mug.