This is a continuation of the question posted in: How to load a jar file at runtime
I am not sure how to continue the method call level. In my opinion, from a clazz object, I would use getMethod or getDeclaredMethod to get a Method object from which I would invoke invoke. Of course, an instance is required to call. Will this be what doRun is called in the sample code?
Do I need to make a call to the doRun.run () method, although I want to execute a different method than the main one (assuming that it is the main doRun object that is called with the run call)?
Just for a more detailed explanation of the original post, I ask: Does doRun.run () execute a new thread executing an instance of an object of a class type clazz?
Thanks for helping me figure it out.
I really looked at "how-should-i-load-jars-dynamic-at-runtime" (sorry, only one hyperlink allowed), however this seemed to violate the Class.newInstance class evil warning in the first post I referred to.
java jar classloader runtime
Todd
source share