Results 1 to 1 of 1
Thread: Adding jars at runtime
- 02-17-2010, 07:25 PM #1Member
- Join Date
- Feb 2010
- Rep Power
Adding jars at runtime
periodical I'm getting jars, which contain Java-Applications. Now I want to search these jars for more jars and add them to my classpath using a Java Standalone program. After that I want to get the included classes using Class.forName and analyze them by reflection.
I already managed it to search the jars for classes. But when I tried to get the classes by Class.forName, I got errors. The cause was the dependencies of some classes via imports. I haven't had the dependencies in my classpath, because I don't know these dependencies at runtime.
That's why I want to put all dependend jars into my classpath. Currently I get all jars that I need via a for loop as strings (complete path and jar name).
Now what I have to do to put these jars within my for loop into my classpath at runtime? I'd like to get the whole jars, not only a few classes from within these jars.
- By png in forum AWT / SwingReplies: 13Last Post: 12-14-2009, 12:14 PM
- By Beju in forum Java AppletsReplies: 5Last Post: 06-16-2009, 11:28 AM
- By dark_cybernetics in forum New To JavaReplies: 0Last Post: 08-19-2008, 04:44 PM
- By bizmut in forum EclipseReplies: 1Last Post: 06-04-2008, 05:41 PM
- By johann_p in forum Advanced JavaReplies: 1Last Post: 06-26-2007, 10:42 PM