Creating a single, flattened, jar file
To create a single, flattened, jar file:
- Create a temporary directory. For example: C:\Temp\FlatJars.
-
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.
- Open a command prompt and navigate to this directory.
-
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