Dynamic loading a class in java with a different package name

后端 未结 3 1503
悲哀的现实
悲哀的现实 2020-12-30 07:04

Is it possible to load a class in Java and \'fake\' the package name/canonical name of a class? I tried doing this, the obvious way, but I get a \"class name doesn\'t match

3条回答
  •  情书的邮戳
    2020-12-30 07:31

    You should be able to knock something up with ASM, though it would be easier to do the package rename once at build time rather than at load time.

提交回复
热议问题