public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
From: Matt Bucknall <matt_bucknall@yahoo.co.uk>
To: gentoo-java@lists.gentoo.org
Subject: Re: [gentoo-java] CLASSPATH deprecated?
Date: Sat, 18 Nov 2006 14:04:49 +0000	[thread overview]
Message-ID: <455F1301.8020600@yahoo.co.uk> (raw)
In-Reply-To: <455E3E4C.9080201@fsfe.org>

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



  reply	other threads:[~2006-11-18 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2006-11-18 14:17     ` Petteri Räty
2006-11-18 15:17       ` Matt Bucknall
2006-11-19  3:57     ` Greg Tassone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455F1301.8020600@yahoo.co.uk \
    --to=matt_bucknall@yahoo.co.uk \
    --cc=gentoo-java@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox