Creating a single, flattened, jar file

To create a single, flattened, jar file:

  1. Create a temporary directory. For example: C:\Temp\FlatJars.
  2. Extract the individual jar files into this directory.
    For example, if there are five jar files, you must extract each of them into the same folder.
  3. Open a command prompt and navigate to this directory.
  4. If you are using JDK 1.7, run this command: jar –cvf "[jarFileName]"./
    Note: If you are using JDK 1.6 or lower, run this command: jar -cvf "[jarFileName]" *.*
    For example, navigate to the C:\temp\FlatJars folder and run this command: jar -cvf "flattened.jar" ./
    A single jar file with the specified name is created under the temporary directory. For example:
    C:\temp\FlatJars\flattened.jar