Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73903 - Ant 1.6.2 doesn't honour CLASSPATH
Summary: Ant 1.6.2 doesn't honour CLASSPATH
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-09 06:16 UTC by Tim
Modified: 2004-12-10 04:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim 2004-12-09 06:16:30 UTC
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.
Comment 1 Thomas Matthijs (RETIRED) gentoo-dev 2004-12-09 06:22:02 UTC
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
Comment 2 Thomas Matthijs (RETIRED) gentoo-dev 2004-12-09 06:22:54 UTC
(as does ours)

i went over it a while ago, and tried to make sure it did the same thing
Comment 3 Tim 2004-12-09 07:33:41 UTC
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.
Comment 4 Thomas Matthijs (RETIRED) gentoo-dev 2004-12-09 07:47:24 UTC
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
Comment 5 Tim 2004-12-10 04:44:22 UTC
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.