🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #224

Re: load jar library

#224
From: Paul Furbacher [TeamB]
Date: Wed, 08 Feb 2006 17:52
41 lines
2500 bytes
Kevin Dean [TeamB] wrote:
> Mark Hage wrote:
> 
>> I'm creating an application and want to use the jar file of another 
>> application.
>> I want the user to point out where the other application is located 
>> and then load that jar file at runtime.
>> How do I do this??
> 
> 
> Look at the class java.net.URLClassLoader.

For a working example, you could download Cayenne M10
release and look at the source code for their Modeler.
The Cayenne Modeler allows you to add JDBC drivers
(i.e. JARs) on the fly.

In particular, look at FileClassLoadingService in
the package, org.objectstyle.cayenne.modeler.  It
essentially uses URLClassLoader.  They subclass it
to encapsulate just a little bit more functionality.

Almost forgot the URL for Cayenne:

   http://objectstyle.org/cayenne


-- 


Paul Furbacher (TeamB)

   Save time, search the archives:
        http://info.borland.com/newsgroups/ngsearch.html

   Is it in Joi Ellis's Faq-O-Matic?
        http://www.visi.com/~gyles19/fom-serve/cache/1.html

   Finally, please send responses to the newsgroup only.
   That means, do not send email directly to me.
   Thank you.
Technical Details
Message-ID: <43ea2f0c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!txtfeed1.tudelft.nl!tudelft.nl!txtfeed2.tudelft.nl!multikabel.net!feed20.multikabel.net!newsfeeder.concepts.nl!213.218.66.70.MISMATCH!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43e9c937$1@newsgroups.borland.com> <xn0ei8kejav2kt000-kdean@www.teamb.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,af6fce94616a216b
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 08 Feb 2006 12:52:38 -0500
From: "Paul Furbacher [TeamB]" <pfurbacher@mac.com>
Organization: Reverse Alchemy, Inc.
User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: load jar library
References: <43e9c937$1@newsgroups.borland.com> <xn0ei8kejav2kt000-kdean@www.teamb.com>
In-Reply-To: <xn0ei8kejav2kt000-kdean@www.teamb.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.142.194.228
Message-ID: <43ea2f0c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1139420940 69.142.194.228 (8 Feb 2006 09:49:00 -0700)
Lines: 41
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!txtfeed1.tudelft.nl!tudelft.nl!txtfeed2.tudelft.nl!multikabel.net!feed20.multikabel.net!newsfeeder.concepts.nl!213.218.66.70.MISMATCH!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail