Article View: borland.public.jbuilder.java.language
Article #173Re: changing class path at run time
From: Shankar Unni
Date: Mon, 03 Apr 2006 19:26
Date: Mon, 03 Apr 2006 19:26
18 lines
2019 bytes
2019 bytes
George Xavier wrote: > Anyway to get back to the issue which started this all: looks like the > runtime never revisits the value of java.class.path after the VM has > started. Wonder why. That's definitely true. The system class loader reads the value of this property *once*, and that's it. It probably has to do with the overhead of getting the value and parsing it, and it would be rather expensive to do that for each class loaded (even a trivial program loads over a hundred classes). If you want a dynamic system class path, you need to interpose a URLClassLoader in between. Or create your own class loader class (not hard to do) which can extend from URLClassLoader, and make it the system class loader by passing in "-Djava.system.class.loader=your.classloader.class.Name".
Technical Details
Message-ID:
<44317701$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<442953d2$1@newsgroups.borland.com> <44296071$1@newsgroups.borland.com> <4429630f@newsgroups.borland.com> <4429a3e5@newsgroups.borland.com> <4429e83e$1@newsgroups.borland.com> <442afca7$1@newsgroups.borland.com> <442b51bb$1@newsgroups.borland.com> <442de557@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,93e0a6dd5feccd47 X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 03 Apr 2006 12:26:57 -0700 From: Shankar Unni <shankarunni@netscape.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0 MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: changing class path at run time References: <442953d2$1@newsgroups.borland.com> <44296071$1@newsgroups.borland.com> <4429630f@newsgroups.borland.com> <4429a3e5@newsgroups.borland.com> <4429e83e$1@newsgroups.borland.com> <442afca7$1@newsgroups.borland.com> <442b51bb$1@newsgroups.borland.com> <442de557@newsgroups.borland.com> In-Reply-To: <442de557@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 64.171.57.66 Message-ID: <44317701$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1144092417 64.171.57.66 (3 Apr 2006 12:26:57 -0700) Lines: 18 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail