GNU bug report logs -
#9306
Java build errors due to trailing colon in CLASSPATH
Previous Next
Reported by: "Daniel Richard G." <skunk <at> iSKUNK.ORG>
Date: Mon, 15 Aug 2011 19:57:02 UTC
Severity: normal
Tags: patch
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Thu, 18 Aug 2011 21:27:39 +0200
with message-id <201108182127.39989.stefano.lattarini <at> gmail.com>
and subject line Re: bug#9306: Java build errors due to trailing colon in CLASSPATH
has caused the GNU bug report #9306,
regarding Java build errors due to trailing colon in CLASSPATH
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
9306: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9306
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
I am using Automake 1.11.1, and have recently encountered a subtle issue
that causes compilation of some Java programs to fail.
Here is a typical build failure, produced from a minimal test case I've
assembled, using OpenJDK on Ubuntu's Natty release:
make[3]: Entering directory `/tmp/automake-java-bug/org/gnu/bug'
CLASSPATH=../../..:./../../..:$CLASSPATH javac -d ../../.. Library.java Application.java
./Library.java:5: duplicate class: org.gnu.bug.Library
public class Library
^
Application.java:9: cannot access Library
bad class file: RegularFileObject[./Library.java]
file does not contain class Library
Please remove or make sure it appears in the correct subdirectory of the classpath.
Library lib = new Library();
^
2 errors
make[3]: *** [classdist_noinst.stamp] Error 1
If I copy-and-paste the javac invocation, edit it slightly, and run
it...
env CLASSPATH=../../..:./../../..: javac -d ../../.. Library.java Application.java
...I get the same error. However, if I remove that trailing colon from
CLASSPATH, and try it again...
env CLASSPATH=../../..:./../../.. javac -d ../../.. Library.java Application.java
...compilation succeeds. If I invoke the above build with
env CLASSPATH=/does-not-exist make
then compilation likewise succeeds.
Note that I do not have CLASSPATH set in my environment. It would appear
that a trailing colon in the CLASSPATH environment variable has a
special meaning attached to it, which makes Automake's use of
CLASSPATH=mumblemumble:$$CLASSPATH in makefiles problematic.
(The straightforward solution would be to replace that construct with
CLASSPATH=mumblemumble$${CLASSPATH:+:$$CLASSPATH}, but whether all
shells can handle that is an open question.)
Attached is a tarball containing the minimal test case.
--Daniel
P.S.: Please Cc: any replies to me, as I am not subscribed to this list.
--
NAME = Daniel Richard G. _\|/_ Remember, skunks
MAIL = skunk <at> iSKUNK.ORG (/o|o\) _- don't smell bad---
MAIL+= skunk <at> alum.MIT.EDU < (^),> it's the people who
WWW = (not there yet!) / \ annoy us that do!
[automake-java-bug.tar.gz (application/x-gzip, attachment)]
[Message part 5 (message/rfc822, inline)]
On Wednesday 17 August 2011, Stefano Lattarini wrote:
> On Tuesday 16 August 2011, Daniel Richard wrote:
> > On Tue, 2011 Aug 16 15:30+0200, Stefano Lattarini wrote:
> > > BTW, are you the same "Daniel Richard G." listed in THANKS with the
> > > address "danielg <at> teragram.com"? If yes, should I update your
> > > address there?
> >
> > The same! That's my work address, and while it remains active, my
> > personal address (@iskunk.org) is the one I usually go by in this realm.
> > Please feel free to update the entry.
> >
> OK, will do with the attached trivial patch.
>
I've pushed both the patches now, and I'm closing the bug report.
Thanks,
Stefano
This bug report was last modified 13 years and 284 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.