Wednesday, August 20, 2014

How to add jars to the class path of your main application when you are doing a distribution/software release

The main application contains the main method that serves as the entry point for running your application. In the top directory of your main application, there is a file named manifest.mf. The file looks like the following.

          Manifest-Version: 1.0
          Class-Path:  . ojdbc14.jar
          Created-By: NetBeans IDE
          Main-Class: com.goodfeeling.Application

List all the jars required by your application in the Class-Path entry in the manifest.mf file. The jar file names are separated by a space, which would look like this.
 
         Class-Path:  . ojdbc14.jar  commons-logging.jar log/log4j.jar your-application-helper.jar

The path entered here corresponding to the location of the jar file relative to your main application. For example if your main application is at C:/Application/MainApplication.jar, the ojdbc14.jar would be located at C:/Application/ojdbc14.jar, and the log4j.jar would be located at C:/Application/log/log4j.jar.

Save this manifest.mf file and make a jar for your main application which would have this file included in the jar file. Distribute the jar together with all the other jars required for running your application and listed in the above Class-Path to the users.

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

                        
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