Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-26-2007, 03:31 PM
Member
 
Join Date: Jun 2007
Posts: 5
johann_p is on a distinguished road
Adding JARs to the classpath at runtime?
I have an JAVA application with a plugin-architecture. Each plugin is described in a config file that tells the application in which JAR the plugin is found etc.

My problem is this: some plugins need additional JARs on the classpath. E.g. the plugin might need the mysql jdbc JAR on the classpath.

What do I have to do to dynamically add a couple of JAR URLs to the classpath so that the system class loader can automatically load from these additional JARs?

I experimented with using my own URL classloader, but the problem I face is this: I add a JAR with addURL and later want to e.g. use the JDBC jar or the javax.script.* libraries to do stuff. Internally, the objects from these libraries want to load classes from the CLASSPATH, but it seems my previous addURL call did not accomplish this.

Either I am still missing some important points here or this has to be done differently.

Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-27-2007, 12:42 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
If you can post your code, we might be able to help..
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set classPath? rgbosque New To Java 3 02-07-2008 04:14 PM
Manifest file in executable jars Java Tip Java Tips 0 12-15-2007 10:16 PM
GNU Classpath 0.96.1 JavaBean Java Announcements 0 11-01-2007 06:14 PM
GNU Classpath 0.96 JavaBean Java Announcements 0 10-16-2007 08:35 PM
how to find unused jars?? orchid Eclipse 4 06-08-2007 12:35 PM


All times are GMT +3. The time now is 04:51 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org