1 |
There are mainly two ways to do this: |
2 |
|
3 |
1. use a "static" classpath in the form |
4 |
create symlinks to system installed jars and then run something like |
5 |
CLASSPATH="lib/commons-logging.jar:lib/commons-collections.jar" |
6 |
java MyApp |
7 |
2. ask java-config to do that for you |
8 |
CLASSPATH=$(java-config -dp commons-beanutils-1.6) java MyApp |
9 |
|
10 |
My preference goes to the first way when packaging an application (if |
11 |
the application expects some jars in some folder) and to the second way |
12 |
when I run my own application (obvioulsy backed by a shell script: I |
13 |
hate writing the same stuff twice) |
14 |
|
15 |
Matt Bucknall wrote: |
16 |
> Hello, |
17 |
> |
18 |
> In section 6 of the Gentoo Java Guide, it mentions that setting a |
19 |
> system-wide CLASSPATH should be considered deprecated because |
20 |
> applications should manage their own classpaths. This makes sense, but I |
21 |
> am wondering, how are applications expected to do this? If an |
22 |
> application needs to make use of a 3rd party JAR, does it have to |
23 |
> include it as part of its own installation so it knows which version it |
24 |
> is, and where it is located, or is there some less brute-force automated |
25 |
> means for an application to locate installed libraries? |
26 |
> |
27 |
> Thanks, |
28 |
> |
29 |
> Matt. |
30 |
> |
31 |
> Send instant messages to your online friends http://uk.messenger.yahoo.com |
32 |
> |
33 |
|
34 |
-- |
35 |
: Federico Fissore |
36 |
: Blog : http://www.fridrik.it/blog/ |
37 |
: Jabber : federico@×××××××××××.org |
38 |
---------+----------------------------------------------------- |
39 |
[] : "The best thing is when you mix free beer and free |
40 |
[][][] | speech 'cause then you get some really free speech" |
41 |
|| : Dick Wall |
42 |
|
43 |
-- |
44 |
gentoo-java@g.o mailing list |