How to add jars and folders to classpath [message #325655] |
Mon, 25 February 2008 12:37 |
Eclipse User |
|
|
|
Originally posted by: automatic.javalobby.org
Hi,
We are developing a plugin, which requires jars and folders containing java files to be added to classpath. We thought of using preferences. However no idea how to modify classpath at runtime.
Does this require writing your own classloader or eclipse does provide some API.
Could you please point out, how to add jars or folders to classpath at runtime. Thanking you in advance.
Regards,
dheer
|
|
|
Re: How to add jars and folders to classpath [message #325711 is a reply to message #325655] |
Mon, 25 February 2008 18:22 |
Eclipse User |
|
|
|
Originally posted by: wharley.bea.com
"reindheer" <automatic@javalobby.org> wrote in message
news:8402208.14671203943056988.JavaMail.root@cp1.dzone.com...
> Hi,
>
> We are developing a plugin, which requires jars and folders containing
> java files to be added to classpath. We thought of using preferences.
> However no idea how to modify classpath at runtime.
>
> Does this require writing your own classloader or eclipse does provide
> some API.
>
> Could you please point out, how to add jars or folders to classpath at
> runtime. Thanking you in advance.
By "at runtime" do you mean after the application has already started, i.e.,
too late to change the classpath that you load the application with? If so,
then yes, AFAIK you will need to use your own classloader. You don't
actually need to write the classloader yourself, you can just use an
URLClassLoader.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04570 seconds