Is it possible to have the System ClassLoader load .class files specified at run time?

后端 未结 6 997
[愿得一人]
[愿得一人] 2021-01-01 00:09

I am writing a static analysis tool for an assignment, it analyses Java bytecode using the ASM library. One of the parts of ASM that we use requires (or at least, appears to

6条回答
  •  甜味超标
    2021-01-01 00:48

    You could try to setup a "launcher" in the startup of your application that creates an URLClassLoader passing it the locations on the classpath and your own .class locations and start the application from that classloader.

    When the SimpleVerifier is loaded by the URLClassLoader it will also be able to load the classes from the extra locations.

提交回复
热议问题