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

Problem, #questionSmugglers are becoming very smart day by day. Now they ha...

#questionSmugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they

Three ways in which a thread can enter the waiting state, What are three wa...

What are three ways in which a thread can enter the waiting state ?

Insert admob code into android application, Need to Insert Admob Code Into ...

Need to Insert Admob Code Into Android Application Project Description: We are seeking Android developer to add Admob code in to our application. It should be very simple

Write a java program in a netbeans project, Write a Java program in a NetBe...

Write a Java program in a NetBeans project that reads a text file containing the names and addresses of several people and displays them all at once or one at a time upon selecting

What is file transfer protocol, What is File Transfer Protocol? This pr...

What is File Transfer Protocol? This protocol is used to upload the files on remote computers. This is used to transfer files among computer on TCP/IP network e.g. internet and

What are the different types of actions in struts, The different types of a...

The different types of actions in Struts are: ? DispatchAction ? LookupDispatchAction ? ForwardAction ? SwitchAction ? IncludeAction

What is the basic principle of rmi architecture, The RMI architecture is ba...

The RMI architecture is based on one significant principle: the definition of behavior and the execution of that behavior are separate concepts. RMI allows the code that describes

Action listener and event listener, differende between action listener and ...

differende between action listener and event listener

Queues, we can insert elements at rear and remove at front bt my question i...

we can insert elements at rear and remove at front bt my question is that how we insert at front in circular queue

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