* [gentoo-java] CLASSPATH deprecated?
@ 2006-11-17 22:13 Matt Bucknall
2006-11-17 22:57 ` Federico Fissore
0 siblings, 1 reply; 6+ messages in thread
From: Matt Bucknall @ 2006-11-17 22:13 UTC (permalink / raw
To: gentoo-java
Hello,
In section 6 of the Gentoo Java Guide, it mentions that setting a
system-wide CLASSPATH should be considered deprecated because
applications should manage their own classpaths. This makes sense, but I
am wondering, how are applications expected to do this? If an
application needs to make use of a 3rd party JAR, does it have to
include it as part of its own installation so it knows which version it
is, and where it is located, or is there some less brute-force automated
means for an application to locate installed libraries?
Thanks,
Matt.
Send instant messages to your online friends http://uk.messenger.yahoo.com
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] CLASSPATH deprecated?
2006-11-17 22:13 [gentoo-java] CLASSPATH deprecated? Matt Bucknall
@ 2006-11-17 22:57 ` Federico Fissore
2006-11-18 14:04 ` Matt Bucknall
0 siblings, 1 reply; 6+ messages in thread
From: Federico Fissore @ 2006-11-17 22:57 UTC (permalink / raw
To: gentoo-java
There are mainly two ways to do this:
1. use a "static" classpath in the form
create symlinks to system installed jars and then run something like
CLASSPATH="lib/commons-logging.jar:lib/commons-collections.jar"
java MyApp
2. ask java-config to do that for you
CLASSPATH=$(java-config -dp commons-beanutils-1.6) java MyApp
My preference goes to the first way when packaging an application (if
the application expects some jars in some folder) and to the second way
when I run my own application (obvioulsy backed by a shell script: I
hate writing the same stuff twice)
Matt Bucknall wrote:
> Hello,
>
> In section 6 of the Gentoo Java Guide, it mentions that setting a
> system-wide CLASSPATH should be considered deprecated because
> applications should manage their own classpaths. This makes sense, but I
> am wondering, how are applications expected to do this? If an
> application needs to make use of a 3rd party JAR, does it have to
> include it as part of its own installation so it knows which version it
> is, and where it is located, or is there some less brute-force automated
> means for an application to locate installed libraries?
>
> Thanks,
>
> Matt.
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>
--
: Federico Fissore
: Blog : http://www.fridrik.it/blog/
: Jabber : federico@jabber.fsfe.org
---------+-----------------------------------------------------
[] : "The best thing is when you mix free beer and free
[][][] | speech 'cause then you get some really free speech"
|| : Dick Wall
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] CLASSPATH deprecated?
2006-11-17 22:57 ` Federico Fissore
@ 2006-11-18 14:04 ` Matt Bucknall
2006-11-18 14:17 ` Petteri Räty
2006-11-19 3:57 ` Greg Tassone
0 siblings, 2 replies; 6+ messages in thread
From: Matt Bucknall @ 2006-11-18 14:04 UTC (permalink / raw
To: gentoo-java
Hi Federico,
Thanks for your reply. My understanding is that java-config is specific
to Gentoo. I assume then, there is no cross-platform means of finding
out whether/where libraries are installed automatically (i.e. for use by
some installation process). Is it normal practice when deploying a Java
application to include all the JARs that it needs so not to rely on the
end-user having some packages already pre-installed?
Thanks again,
Matt.
Federico Fissore wrote:
> There are mainly two ways to do this:
>
> 1. use a "static" classpath in the form
> create symlinks to system installed jars and then run something like
> CLASSPATH="lib/commons-logging.jar:lib/commons-collections.jar"
> java MyApp
> 2. ask java-config to do that for you
> CLASSPATH=$(java-config -dp commons-beanutils-1.6) java MyApp
>
> My preference goes to the first way when packaging an application (if
> the application expects some jars in some folder) and to the second
> way when I run my own application (obvioulsy backed by a shell script:
> I hate writing the same stuff twice)
>
> Matt Bucknall wrote:
>> Hello,
>>
>> In section 6 of the Gentoo Java Guide, it mentions that setting a
>> system-wide CLASSPATH should be considered deprecated because
>> applications should manage their own classpaths. This makes sense, but I
>> am wondering, how are applications expected to do this? If an
>> application needs to make use of a 3rd party JAR, does it have to
>> include it as part of its own installation so it knows which version it
>> is, and where it is located, or is there some less brute-force automated
>> means for an application to locate installed libraries?
>>
>> Thanks,
>>
>> Matt.
>>
>> Send instant messages to your online friends
>> http://uk.messenger.yahoo.com
>
Send instant messages to your online friends http://uk.messenger.yahoo.com
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] CLASSPATH deprecated?
2006-11-18 14:04 ` Matt Bucknall
@ 2006-11-18 14:17 ` Petteri Räty
2006-11-18 15:17 ` Matt Bucknall
2006-11-19 3:57 ` Greg Tassone
1 sibling, 1 reply; 6+ messages in thread
From: Petteri Räty @ 2006-11-18 14:17 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 978 bytes --]
Matt Bucknall kirjoitti:
> Hi Federico,
>
> Thanks for your reply. My understanding is that java-config is specific
> to Gentoo. I assume then, there is no cross-platform means of finding
> out whether/where libraries are installed automatically (i.e. for use by
> some installation process). Is it normal practice when deploying a Java
> application to include all the JARs that it needs so not to rely on the
> end-user having some packages already pre-installed?
>
> Thanks again,
> Matt.
>
>
Nope, not in the java world. Hopefully we will have something like
auto*, pkg-config etc in the java world too some day. It seems to be
very usual for upstreams to include all the dependencies inside their
source packages but the Linux distributions would appreciate if you also
distributed a src tarball without these dependencies to save bandwidth
and disk space. Packages are not going to use the bundled stuff.
Regards,
Petteri Räty (Betelgeuse
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] CLASSPATH deprecated?
2006-11-18 14:17 ` Petteri Räty
@ 2006-11-18 15:17 ` Matt Bucknall
0 siblings, 0 replies; 6+ messages in thread
From: Matt Bucknall @ 2006-11-18 15:17 UTC (permalink / raw
To: Petteri Räty; +Cc: gentoo-java
Okay. Thanks for the help.
Petteri Räty wrote:
> Matt Bucknall kirjoitti:
>
>> Hi Federico,
>>
>> Thanks for your reply. My understanding is that java-config is specific
>> to Gentoo. I assume then, there is no cross-platform means of finding
>> out whether/where libraries are installed automatically (i.e. for use by
>> some installation process). Is it normal practice when deploying a Java
>> application to include all the JARs that it needs so not to rely on the
>> end-user having some packages already pre-installed?
>>
>> Thanks again,
>> Matt.
>>
>>
>>
>
> Nope, not in the java world. Hopefully we will have something like
> auto*, pkg-config etc in the java world too some day. It seems to be
> very usual for upstreams to include all the dependencies inside their
> source packages but the Linux distributions would appreciate if you also
> distributed a src tarball without these dependencies to save bandwidth
> and disk space. Packages are not going to use the bundled stuff.
>
> Regards,
> Petteri Räty (Betelgeuse
>
>
Send instant messages to your online friends http://uk.messenger.yahoo.com
--
gentoo-java@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-java] CLASSPATH deprecated?
2006-11-18 14:04 ` Matt Bucknall
2006-11-18 14:17 ` Petteri Räty
@ 2006-11-19 3:57 ` Greg Tassone
1 sibling, 0 replies; 6+ messages in thread
From: Greg Tassone @ 2006-11-19 3:57 UTC (permalink / raw
To: gentoo-java
[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]
On Saturday 18 November 2006 06:04, Matt Bucknall wrote:
...
> I assume then, there is no cross-platform means of finding
> out whether/where libraries are installed automatically (i.e. for use by
> some installation process).
That is correct. Java leaves that to the user and/or the user's operating
system to configure as desired.
> Is it normal practice when deploying a Java
> application to include all the JARs that it needs so not to rely on the
> end-user having some packages already pre-installed?
Yes, this is quite common. IMO this is primarily born out of the
cross-platform nature of most Java applications combined with simplification
(or laziness) by the program author(s).
A nice balance between the extremes was already mentioned by Petteri Raty:
offer archives without library dependencies for easier inclusion into
installers (and operating systems like Gentoo). That way the user and
operating system maintainers can pick the best option for their needs.
~ Greg
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-11-19 3:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-17 22:13 [gentoo-java] CLASSPATH deprecated? Matt Bucknall
2006-11-17 22:57 ` Federico Fissore
2006-11-18 14:04 ` Matt Bucknall
2006-11-18 14:17 ` Petteri Räty
2006-11-18 15:17 ` Matt Bucknall
2006-11-19 3:57 ` Greg Tassone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox