Results 1 to 2 of 2
- 06-26-2007, 01:31 PM #1Member
- Join Date
- Jun 2007
- Rep Power
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.
- 06-26-2007, 10:42 PM #2
- By rgbosque in forum New To JavaReplies: 3Last Post: 02-07-2008, 03:14 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 12-15-2007, 09:16 PM
- By JavaBean in forum Java SoftwareReplies: 0Last Post: 11-01-2007, 05:14 PM
- By JavaBean in forum Java SoftwareReplies: 0Last Post: 10-16-2007, 06:35 PM
- By orchid in forum EclipseReplies: 4Last Post: 06-08-2007, 10:35 AM