Gentoo Archives: gentoo-java

From: Matt Bucknall <matt_bucknall@××××××××.uk>
To: gentoo-java@l.g.o
Subject: Re: [gentoo-java] CLASSPATH deprecated?
Date: Sat, 18 Nov 2006 14:04:56
Message-Id: 455F1301.8020600@yahoo.co.uk
In Reply to: Re: [gentoo-java] CLASSPATH deprecated? by Federico Fissore
1 Hi Federico,
2
3 Thanks for your reply. My understanding is that java-config is specific
4 to Gentoo. I assume then, there is no cross-platform means of finding
5 out whether/where libraries are installed automatically (i.e. for use by
6 some installation process). Is it normal practice when deploying a Java
7 application to include all the JARs that it needs so not to rely on the
8 end-user having some packages already pre-installed?
9
10 Thanks again,
11 Matt.
12
13
14 Federico Fissore wrote:
15 > There are mainly two ways to do this:
16 >
17 > 1. use a "static" classpath in the form
18 > create symlinks to system installed jars and then run something like
19 > CLASSPATH="lib/commons-logging.jar:lib/commons-collections.jar"
20 > java MyApp
21 > 2. ask java-config to do that for you
22 > CLASSPATH=$(java-config -dp commons-beanutils-1.6) java MyApp
23 >
24 > My preference goes to the first way when packaging an application (if
25 > the application expects some jars in some folder) and to the second
26 > way when I run my own application (obvioulsy backed by a shell script:
27 > I hate writing the same stuff twice)
28 >
29 > Matt Bucknall wrote:
30 >> Hello,
31 >>
32 >> In section 6 of the Gentoo Java Guide, it mentions that setting a
33 >> system-wide CLASSPATH should be considered deprecated because
34 >> applications should manage their own classpaths. This makes sense, but I
35 >> am wondering, how are applications expected to do this? If an
36 >> application needs to make use of a 3rd party JAR, does it have to
37 >> include it as part of its own installation so it knows which version it
38 >> is, and where it is located, or is there some less brute-force automated
39 >> means for an application to locate installed libraries?
40 >>
41 >> Thanks,
42 >>
43 >> Matt.
44 >>
45 >> Send instant messages to your online friends
46 >> http://uk.messenger.yahoo.com
47 >
48
49 Send instant messages to your online friends http://uk.messenger.yahoo.com
50
51 --
52 gentoo-java@g.o mailing list

Replies

Subject Author
Re: [gentoo-java] CLASSPATH deprecated? "Petteri Räty" <betelgeuse@g.o>
Re: [gentoo-java] CLASSPATH deprecated? Greg Tassone <greg@×××××××.net>