I am trying to create a jar file for the .java program
followed the steps as
Step 1. Create a 'mywork' folder Step 2: Put the XYZ.java and the gson.jar file under the mywork folder Step 3. Use javac -cp .:gson.jar XYZ.class Step 4. Create Jar File -> jar cf XYZ.jar XYZ.class Step 5. Create a Manifest.txt and modify it to include MainClass:XYZ Step 6. Modify Manifest.txt to include classpath for gson.jar Step 7. Then run the command-> jar cfm XYZ.jar Manifest.txt XYZ.class argument1 argument2 when I am doing step 7 I am getting
"java.io.IOException: invalid header field" error Where am I going wrong, please help me to solve the problem.
My Manifest.txt is like
Manifest-Version: 1.0 Class-Path:gson.jar Created-By: 1.7.0_06 (Oracle Corporation) Main-Class: XYZ main method:
public static void main(String[] args) throws Exception { // Enter the values for the arguments String dirstr = args[0]; String logfiledirstr = args[1]; XYZ data = new XYZ(); data.method1(dirstr,logfiledirstr); }
argument1andargument2?XYZcode)