What is jar archives, JAVA Programming

Assignment Help:

What is JAR archives?

JAR archives are ZIP archives along with a different extension. They contain a hierarchy of files and directories. In spirit a JAR file can take the place of a directory containing its contents. This has several uses involving the distribution of associated classes as a single file.

The JDK involve a jar program modeled after the Unix tar program in which will bundle up files and directories into a JAR archive. For instance, suppose your homework directory contains the file Trivia.class.

Now suppose in which Trivia is in the package edu.poly.utopia.eharold.games. Also suppose that the directory /home/users/eharold/homework/ contains (in various sub-directories) all the files and directories essential to run the program edu.poly.utopia.eharold.games.Trivia. You can pack up everyhting in the edu package into a JAR archive like this:

$ cd /home/users/eharold/homework
$ jar cvf eharold.jar edu
The edu directory and all its contents are recursively stored in the archive named eharold.jar. The name of the archive is not important, only its contents.

This archive might now be added to the class path like this, or in whatever fashion you normally add directories to the class path on your platform of choice:

$ setenv CLASSPATH $CLASSPATH:eharold.jar

The major thing to note here is in which the JAR file is now taking the place of an whole directory hierarchy.
In Java 1.2 you can also place it within the ext directory of your jre/lib directory.

Either way, all the classes in the archive will be added to the class path and will be easy to get to to your programs.


Related Discussions:- What is jar archives

What are the basic advantages of jms, JMS is asynchronous in nature. Theref...

JMS is asynchronous in nature. Therefore not all the pieces need to be up all the time for the application to function as a whole. Even if the receiver is down the MOM will kept th

Answer, a program to find the area under curve y=f(x) between x=a and x=b,i...

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b

What type of operations takes place inside microprocessors, What type of op...

What type of operations takes place inside Microprocessors Building Blocks? Enlist them along with brief description. Bus Interface Unit: The bus interface unit is the part o

Hospital management system in java-jsp, Hospital Management System: Te...

Hospital Management System: Technology Used Java-JSP, Apache Tomcat (webserver), SQL SERVER 2000. This project is aimed at developing a web-based system for taking records

Series, Write a Java program to find the sum of 1+3+5+…. , for 10 terms in ...

Write a Java program to find the sum of 1+3+5+…. , for 10 terms in the series.

Write a java code to draw ovals and circles, Write a java code to draw Oval...

Write a java code to draw Ovals and Circles? Java has techniques to draw outlined and filled ovals. As you'd probably guess these methods are called drawOval() and fillOval() c

Simple Java Project Please help, I have a project due tonight and I need he...

I have a project due tonight and I need help setting up the project I know what I need to put in the class but not sure how to set it up properly

Data types in javascript, A value, the data assigned to a variable, may con...

A value, the data assigned to a variable, may contain any sort of data. Though, JavaScript considers data to fall into many possible types. Based on the type of data, certain opera

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd