Tuesday, August 26, 2014

Run .jar file in Windows

1. Specify the Application entry point
      Method 1
            A. Create the manifest.mf file with the following content. This file must ends with an empty line after the last line, otherwise, it will not be processed properly.


           Main-Class: <package>.<file>.class

            B. Create the jar file and specify the application entry point by executing one of the following commands.

                      jar -cfm <file>.jar manifest.mf  <package>/*.class

      Method 2
            Set the entry point to <package>.<file>.class by running the following command.

                   jar -cfe <file>.jar <package>.<file> <package>/<file>.class

2. Put all the jar files and other required files such as properties files if they are not included in the jar already in the same directory.

   To run from the command line, type: java -jar <file>.jar


  To run by double click the jar file, the .jar file type has to be associated with the java execution program. To set the association, do the following.

     A. Open the Control Panel
     B. Go to Programs\Default Programs
     C. Click Associate a file type or protocol with a program
     D. Scroll down the list, double click on the .jar entry
     E. Click the Browse and choose C:\Program Files\Java\jre7\bin\javaw or wherever your java is installed
     F. Click Open and then OK

3. Follow the steps here to create a desktop icon to launch the application by double clicking on the icon.
          A. Right click on desktop, choose New, then Shortcut.
          B. Enter java -jar <file>.jar in the text box, and click Next
          C. Enter a <name> for your shortcut, then click Finish
          D. Right click on the <name> shortcut on your desktop and choose Properties
          E. In the Start in: box, enter the path of the directory where the <file>.jar is located. click Apply.
          F. Click the Change Icon button and browse to select an image to use for your shortcut. Click OK and OK.

---------------------------------------------------------------------------------------------------------------

                        

If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.

No comments:

Post a Comment