Tuesday, March 20, 2007
I use "ant" for building java code in my projects.
Recently I have enabled -Xlint for javac ant task,
srcdir="${src.home}/"
destdir="${class.home}"
debug="true"
source="1.4"
target="1.4"
optimize="true"
listfiles="true"
deprecation="true"
includes="common/**,util/**"
>
However, after enabling "-Xlint", the following warning showed up,
[javac] /Users/snambi/opentrade/otp/src/util/SimpleMail.java
[javac] /Users/snambi/opentrade/otp/src/util/StringUtils.java
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/activemq-3.0/lib/log4j.jar": no such file or directory
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/activemq-3.0/lib/log4j-core.jar": no such file or directory
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/mantaray_1.8_bin/ext/log4j.jar": no such file or directory
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/mantaray_1.8_bin/ext/log4j-core.jar": no such file or directory
[javac] 4 warnings
The code compiled properly and no problems in executing the program.
But this warning was annoying.
So I checked the $CLASSPATH within "Ant". There are no problems. It had "log4j-1.4.8.jar".
Still "ant" complains about the "log4j.jar" not in path.
After some googling and searching for a reason for this warning, I found the following,
$jar -xvf commons-logging-1.0.3.jar META-INF/MANIFEST.MF
inflated: META-INF/MANIFEST.MF
snambis-computer:/Users/snambi/opentrade/otp/software/activemq-3.0/lib>
$cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: Apache Ant 1.5.1
Extension-Name: org.apache.commons.logging
Specification-Vendor: Apache Software Foundation
Specification-Version: 1.0
Implementation-Vendor: Apache Software Foundation
Implementation-Version: 1.0.3
Class-Path: log4j.jar log4j-core.jar
The "MANIFEST.MF" file is pointing to "log4j.jar" and "log4j-core.jar".
Hence the warning.
Recently I have enabled -Xlint for javac ant task,
srcdir="${src.home}/"
destdir="${class.home}"
debug="true"
source="1.4"
target="1.4"
optimize="true"
listfiles="true"
deprecation="true"
includes="common/**,util/**"
>
However, after enabling "-Xlint", the following warning showed up,
[javac] /Users/snambi/opentrade/otp/src/util/SimpleMail.java
[javac] /Users/snambi/opentrade/otp/src/util/StringUtils.java
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/activemq-3.0/lib/log4j.jar": no such file or directory
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/activemq-3.0/lib/log4j-core.jar": no such file or directory
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/mantaray_1.8_bin/ext/log4j.jar": no such file or directory
[javac] warning: [path] bad path element "/Users/snambi/opentrade/otp/software/mantaray_1.8_bin/ext/log4j-core.jar": no such file or directory
[javac] 4 warnings
The code compiled properly and no problems in executing the program.
But this warning was annoying.
So I checked the $CLASSPATH within "Ant". There are no problems. It had "log4j-1.4.8.jar".
Still "ant" complains about the "log4j.jar" not in path.
After some googling and searching for a reason for this warning, I found the following,
$jar -xvf commons-logging-1.0.3.jar META-INF/MANIFEST.MF
inflated: META-INF/MANIFEST.MF
snambis-computer:/Users/snambi/opentrade/otp/software/activemq-3.0/lib>
$cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: Apache Ant 1.5.1
Extension-Name: org.apache.commons.logging
Specification-Vendor: Apache Software Foundation
Specification-Version: 1.0
Implementation-Vendor: Apache Software Foundation
Implementation-Version: 1.0.3
Class-Path: log4j.jar log4j-core.jar
The "MANIFEST.MF" file is pointing to "log4j.jar" and "log4j-core.jar".
Hence the warning.