Posts

Showing posts from October, 2016

2023-09-13, Wednesday, Cloudy

新工上遇上了挫折。寫好的東西達不到標準需要別人執手尾了。雖然同事說沒關係,但反應了自己的不足。有時反省自己為何做事總是不好,為何別人有留意或想到的事情自己總是忽略。現在覺得是自己天生的思考模式問題,可能看多少書都沒用。或者自己應該更適合做地盤呢類工作,而唔係IT。

no main manifest attribute in jar file

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