Gentoo Archives: gentoo-java

From: Vincent Schut <schut@×××××××××.nl>
To: gentoo-java <gentoo-java@l.g.o>
Subject: Re: [gentoo-java] java 5 classpath policy?
Date: Wed, 24 May 2006 06:52:13
Message-Id: 4474026F.8070106@sarvision.nl
In Reply to: Re: [gentoo-java] java 5 classpath policy? by Joshua Nichols
1 Joshua Nichols wrote:
2
3 >Vincent Schut wrote:
4 >
5 >
6 >>Hi all,
7 >>
8 >>when using java-config-2 from migration-overlay, it says 'deprecated'
9 >>for all classpath related functions. I tried to find some more info on
10 >>this, but couldn't find it. Maybe someone here can elaborate a bit more
11 >>on how to work with java classpath (system and user) in the new gentoo
12 >>java system? E.g. if I want to have some packages in my classpath, how
13 >>would I do that using the new system? And how is this working
14 >>together/conflicting with the current (old) items in /etc/env.d/ ?
15 >>
16 >>Cheers,
17 >>Vincent.
18 >>
19 >>
20 >>
21 >
22 >Setting a user and system wide classpath is deprecated because it can
23 >cause several issues.
24 >
25 >For example, say you put the classes from foo-2.0 on your classpath.
26 >Then you emerge something that uses foo-1.0. This would because foo
27 >would be slotted. However, when the build takes place, foo-2.0 could be
28 >on the classpath before foo-1.0. It may have the same classnames and
29 >whatnot, but different API. The differences between the APIs could then
30 >cause the build to fail.
31 >
32 >Similarly, this scenario may also occur while running an application.
33 >foo-1.0 might be expected, but foo-2.0 is on the classpath first... so
34 >it may be missing methods, or have different behavior, and so on.
35 >
36 >
37 >As for what to do instead of setting the classpath, it depends on what
38 >you're trying to do. If you have an application that needs a certain
39 >thing on the classpath, it is best to have a launcher script which sets
40 >the right CLASSPATH. If you're building something that needs a
41 >particular library, you should make the something be explicitly aware of
42 >what it needs. In ant, this could mean having a lib directory with all
43 >the jars (or symlinks to them), then you create a <path> that all your
44 ><javac> and <java>'s use. This would really be dependent on how you're
45 >building your project.
46 >
47 >This problem, and workarounds for it, are in the updated user
48 >documentation
49 >(https://svn.gentooexperimental.org/svn/java/migration/docs/java-user.html).
50 >
51 >Hope this clarifies,
52 >
53 >
54 It sure does. Thanks.
55
56 Vincent.
57
58 >Josh
59 >
60 >
61
62 --
63 gentoo-java@g.o mailing list