The value of the Main-Class attribute must not have the .class extension appended to the class name.


Doctor Doctor

Doctor: Don't worry, after the operation, you will become a new man."

Patient: "Wonderful, will you send the bill to the old man."


I like frogs

A medical student was preparing a report on frogs. He cut one leg and said, "Jump." The frog jumped. He cut the second leg and said, "Jump." The frog jumped again. He cut third leg and said, "Jump." The frog jumped. Then he cut the fourth leg and said, "Jump." The frog didn't jump. He shouted repeatedly, but the frog didn't jump. In his report he wrote: "After cutting all the legs, a frog becomes deaf."


How to remember your wife's birthday.

A married man to his friend: "The most effective way to remember your wife's Wife birthday is to forget it once."


My beautiful wife

John: "You look just like my wife. The only difference is that of a beard and moustache."

Ron: "But I don't have a beard or moustache."

John: "You don't, but my wife does."

Chapter 1 Executable Java Archives

The Main-Class Attribute

This attribute is used by stand-alone applications that are bundled into executable jar files, which can be invoked by the Java runtime directly. The value of this attribute defines the relative path of the main application class that the launcher will load at startup time. The value must not have the .class extension appended to the class name.


Creating Executable JAR file

c:\myframe>jar cmf MyFrame.mft MyFrame.jar *.class

Open the windows explorer and double click the "MyFrame.jar" file. If nothing goes wrong, you will see the following:



Options

c - Creates a new or empty archive on the standard output.

f - It specifies a jar file to process. In the case of creation, this refers to the name of the jar file to be created.

m - Include manifest information from specified pre-existing manifest file.

 

In this chapter, I have shown you how to create executable Java archives. In the next chapter, you will learn how to invoke the DOS command interpreter.


Contents         Top                              Move to the preceding page Move to the next page
© 2001 www.universalteacher.com. All rights reserved