Why use JAR file
I have a basic question. Why we use JAR files? If the purpose is to compress the package, ZIP format is there. Why Java has its own JAR format?
I see a lot of JAR files in Java applications and frankly, I think it just makes things complicated. I believe that everything can be done even without JAR files.
JAR Is an archive and is "known" by servlet containers etc. The major advantage is for standardization and ease of deployment. You'll get to appreciate it as you do more production code ...
- Shelon Padmore
JAR file consists of class files. These files will be used by the application at Runtime. These are advantageous b'coz the application's performance improves since it need not compile the source code while running, Security of the application will be better since the class files code cannot be altered easily. These are the standards followed by the Java.
u know i know the zip format files but java dont,java knows jar files..
suppose u created 2 classes in 2 diffrent packages p1,p2 . to access that classes into another class in any deffrent package waht can u do..? u hav 2 export those 2 packages into ine jar file and put that jar file in somewhere in the system ,and set the class path to access that jar file.. and import the packages in the program..like that jars works