Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Craig Daniels   on Jul 12 In Java Category.

  
Question Answered By: Ulfah Hashmi   on Jul 12

First you need a manifest file. This just tells the jar  which
classes 'main' is to be run when the file is double-clicked on. The
manifest file is usually two lines:

Manifest-Version: 1.0
Main-Class: FileToBeRun

(Although you can probably leave out the version number.)
Note lack of extension on 'FileToBeRun'.

Then, at the command prompt, type:
jar -cmf MyProgManifest.txt MyProg.jar *.class

The options after -cmf must come in that order too.

Share: