When I build a java project using ant I get variuos errors. I found the problem is in the /usr/bin/ant script. The 1.6.2 ant script doesn't use the user's CLASSPATH environment variable. The original 1.6.2 ant from apache does that, but for some reason it's not in the gentoo 1.6.2 ant script. This worked in 1.5.4 though. This was removed between 1.5.4 and 1.6.2 if [ -n "$CLASSPATH" ] ; then LOCALCLASSPATH="$CLASSPATH" So the ant script doesn't care about the CLASSPATH at all in 1.6.2. When developing java applications that's what most people use. I suggest readding those lines or similar ones. Reproducible: Always Steps to Reproduce: 1. ant <java-project> 2. 3.
can you tell me on what line you think the script from apache-ant-1.6.2 does it? as far as i can tell it passes CLASSPATH along with -lib to ant
(as does ours) i went over it a while ago, and tried to make sure it did the same thing
Is -lib really used? man page of sun jdk explains -classpath, but says nothing about -lib. Maybe blackdown uses -lib? Anyway, in what way is -lib different from -classpath? In original (ant.apache.org) apache-ant-1.6.2/src/script/ant , line 185 if [ -n "$CLASSPATH" ] ; then # merge local and specified classpath if [ -z "$LOCALCLASSPATH" ] ; then LOCALCLASSPATH="$CLASSPATH" ... In dev-java/ant/ant-1.5.4-r2, line 53 if [ -n "$CLASSPATH" ] ; then LOCALCLASSPATH="$CLASSPATH" fi In dev-java/ant/ant-1.6.2-rc6 there is no LOCALCLASSPATH=$CLASSPATH. I think there should be one.
which inside a if $rpm_mode && [ -f /usr/bin/build-classpath ] ; then which is never true? -lib is used by ant itself http://ant.apache.org/manual/running.html#commandline
I don't know why it works when java gets my classpath, but doesn't when it's passed to ant instead. It seems I could skip classpath altogether. It works when having the classpath in my build.xml file, so I close this bug. Still a mystery though.