Packing an XML Parser with a Java Application

Packing an XML Parser with a Java Application

You can pack the XML Parser along with the Java Application you are shipping. The following steps show how to do this. I used the Apache’s Xerces and Xalan parsers for XML and XSLT as an example.

  1. Un-Jar the xerces.jar and xalan.jar into a temporary directory.
  2. Copy your Java application class files to the same directory. If you use packages in your code, copy the entire directory created after compilation of the Java Code.
  3. In the Meta-Inf information for the JAR file, give the following line:
        Main-Class: MainClassFile

    This will start the first class file which has to be executed by the JavaVirtual Machine.

  4. Now JAR the contents in the temporary directory (not the directory itself) into a .Jar file.
  5. Double click on the created .Jar File. This will load the application.

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist