Gentoo Archives: gentoo-java

From: Joshua Nichols <nichoj@g.o>
To: Henrique Ferreiro <henrique.ferreiro@×××××.com>
Cc: Jon Severinsson <jon@×××××××××××.net>, gentoo-java@l.g.o
Subject: Re: [gentoo-java] Re: problems compiling junit
Date: Fri, 14 Apr 2006 01:29:13
Message-Id: 443EFB00.3080309@gentoo.org
In Reply to: Re: [gentoo-java] Re: problems compiling junit by Henrique Ferreiro
1 Henrique Ferreiro wrote:
2 >>>> I did not modify jdk.conf. Every line is commented.
3 >> Then ant-core, as well as junit, should be build with 1.4. Is that the case?
4 > No. ant-core is being built with jdk-1.5. Anyway junit does not compile using
5 > 1.4 with ant-core.
6 >
7 >
8
9
10 Alright... I'm pretty sure what the problem is. If you take a look at
11 /usr/bin/ant... at some point, it pulls in a bunch of jars from several
12 packages. This is necessary to make sure that all the ant tasks work
13 properly. One of these happens to be junit....
14
15
16 So what I believe is happening... you have junit installed (and built
17 with 1.5), then go to rebuild with 1.4. The ebuild calls ant, which
18 pulls in junit compiled with 1.5 onto the classpath. When javac tries to
19 resolve junit classes... it's getting them from the 1.5-built junit,
20 instead of the junit which is being built. So, the workaround would be
21 to unmerge junit before trying to rebuidl it with 1.4.
22
23 Essentially, this problem comes down to who we handle /usr/bin/ant, and
24 how it pulls in all its dependencies. It is currently hardcoded to bring
25 in certain packages, which is less than ideal, because we need to have
26 fine-grain control over the classpath. In particular, when building
27 packages, we don't want to include the already-compiled version that is
28 living on the system.
29
30 Aside from this, I recommend you try the java-1.5-fixer I posted in a
31 different thread. It actually goes through all of ant's dependencies,
32 and if any were built with 1.5, will unmerge them, and merge them again.
33
34 Hope this helps,
35
36 Josh
37 --
38 gentoo-java@g.o mailing list

Replies

Subject Author
Re: [gentoo-java] Re: problems compiling junit Henrique Ferreiro <henrique.ferreiro@×××××.com>
[gentoo-java] Re: problems compiling junit Wiktor Wandachowicz <siryes@×××××.com>