Recently I need to create a jar with ant so after a few search I found that I have to work with a manifest file. Everything seems fine and I can build my jar file with ant happily until I use the ant's manifest task to add manifest file into jar file and run with "java -jar xxx.jar", I always get an error: no main manifest attribute in xxx.jar I was wondering why it doesn't work after I have follow the instructions here and using the examples there as reference. After started things all over again with basic Java tutorial on Oracle's website, finally I figure it out. It was all about the manifest file the ant task genereted: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.9.7 Created-By: 1.8.0_91-b14 (Oracle Corporation) Built-By: Whelan Chan Name: common Main-Class: xxx.xxx.util.xxxRunner There are two EOL after the "Built-By" attribute and so all the attributes after it could not be recognized. After I removed the extra EOL: Manif...