aspose file tools*
The moose likes Beginning Java and the fly likes What is JAR? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is JAR?" Watch "What is JAR?" New topic
Author

What is JAR?

Frederick Winsnes
Greenhorn

Joined: Feb 22, 2011
Posts: 17

Hi
This might be a stupid question, but what is a JAR-file and what does it do?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11314
    
  16

it's a Java ARchive. Basically, you can think of it as a zip file of your compiled .class files (and other resources like .jpg or whatever). They are used for distributing your application.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
bill steve
Greenhorn

Joined: Feb 22, 2011
Posts: 7
i use IZArc to unzip them so i can see what class are in them. really helps......
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61214
    
  66

Any application that can handle zip files can handle jar files -- they're just zip files with a .jar file type.

If you've got a Java JDK installed, the jar command line command can be used.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Death Arte
Greenhorn

Joined: Feb 17, 2011
Posts: 21

it also used to easily execute the program that you compiled. "Executable JAR"
Luigi Plinge
Ranch Hand

Joined: Jan 06, 2011
Posts: 441

You should search first. You can type "jar file" into Wikipedia (or Google, which gives the Wikipedia page as its top answer) and get a comprehensive answer without asking other people to type out an answer for you.

I think Wikipedia is one of the default search engines on Firefox, so it's literally about 3 clicks away.
Frederick Winsnes
Greenhorn

Joined: Feb 22, 2011
Posts: 17

Luigi Plinge wrote:You should search first. You can type "jar file" into Wikipedia (or Google, which gives the Wikipedia page as its top answer) and get a comprehensive answer without asking other people to type out an answer for you.

I think Wikipedia is one of the default search engines on Firefox, so it's literally about 3 clicks away.


Your'e right. I was to quick to post, but a bit late to do anything about that. Will search in the future tho.


Thanks for the answers everyone!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150
    
  18

bill steve wrote:i use IZArc to unzip them so i can see what class are in them. really helps......

You can open JAR files with tools that handle ZIP files. But the standard program that's included with the JDK to work with JAR files is the jar tool. It doesn't have a GUI, it works on the command line only.

And here you can find the official documentation about JAR files: JAR File Overview.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
Luigi Plinge wrote:You should search first. . . .
And try searching here under the "deployment" heading.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is JAR?