How to use URLClassLoader to load a *.class file?

后端 未结 5 2133
旧时难觅i
旧时难觅i 2020-11-27 16:13

I\'m playing around with Reflection and I thought I\'d make something which loads a class and prints the names of all fields in the class. I\'ve made a small hello world typ

5条回答
  •  有刺的猬
    2020-11-27 16:37

    I had the same problem but I found this as a solution:

    System.getProperty("java.class.path")
    

    This give you the jar, and classes path. From here you are able to manage your process.

提交回复
热议问题