What is runnable jar archives, JAVA Programming

Assignment Help:

What is Runnable JAR archives

You can run a program stored within the JAR archive that has a main() method like this:

$ java -cp eharold.jar MainClassName
You must use the fully package qualified name. For instance,

$ java -cp eharold.jar edu.poly.utopia.eharold.games.Trivia

The -cp flag adds the jar file to the class path.

In Java 1.2 you can add a Main-Class attribute to a JAR file's manifest so in which the person who runs the program does not requires to know the name of the name of the class with the main() method. This attribute has the subsequent form

Main-Class: edu.poly.utopia.eharold.games.Trivia

Put this line into a file known as (for example) MyManifest.txt. Then use this command line to package the JAR:

$ jar cvmf MyManifest.txt eharold.jar edu
This will copy data from the file MyManifest.txt into the JAR's own manifest file, and add the directory edu to the archive.

To run the program packaged in the jar file eharold.jar you simply type:

$ java -jar eharold.jar
Java will look inside the JAR archive's manifest to search out which class's main() method it should run.


Related Discussions:- What is runnable jar archives

Write a java program to take data from excel files, Java program will be ta...

Java program will be take data from excel files (left diagram), and uses can be able to enter the input(middle diagram) in website when run the input the result appear in Pie 2D or

I want java swing desktop audio video chat server, Project Description: ...

Project Description: We have a project on hold to complete a due task of a Java swing desktop audio and video server. The admin panel and other features are already implemented.

Explain what occur when an object is created in java, Explain what occur wh...

Explain what occur when an object is created in Java?

String, in java string is a

in java string is a

Prepare android antivirus with locate device capability, Prepare Android An...

Prepare Android Antivirus with locate device capability Project Description: We need a developer that can develop an Android Antivirus similar to lookout Developer need to prov

Write a java adb client, Write a Java ADB client to perform the following- ...

Write a Java ADB client to perform the following- The client will read the contents of the file - invoice.txt. The first line of the file will display the type of the currency. The

What are the implicit objects in jsp, Implicit objects are formed by the we...

Implicit objects are formed by the web container and have information related to a particular request, page, or application. They are request, response, pageContext, session, appli

Confidentiality and privacy - security, The confidentiality and privacy may...

The confidentiality and privacy may be accomplished through encryption. Encryption may be: Private-key or symmetric: This is based on a single key. This needs the sender and the

Different points where weaving can be applied, What are the different point...

What are the different points where weaving can be applied? Ans) There are three points ? Compile Time ? Classload Time ? Runtime

State the significance of public and private modifiers, State the significa...

State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by

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