Locating a class file from a class loader by name
Rafael Winterhalter
rafael.wth at gmail.com
Fri Nov 13 12:04:06 UTC 2015
Hello,
I recently started testing several byte code manipulation frameworks
against a recent build of Jigsaw and found a common problem of all of these
libraries. I am myself the developer of Byte Buddy (
https://github.com/raphw/byte-buddy) and I know most tools for code
manipulation fairly well. I hope that this mailing list can provide me some
me advice on patching my library and providing help to other maintainers.
Especially in the context of using the instrumentation API, it is often not
possible to do reflection on load classes. Rather, code manipulation tools
read Java class files and parse these files for exposing classes using a
similar API but without the possibility to invoke a method or to read a
field.
Typically these tools read Java class files by querying a class loader for
the class file, e.g.:
ClassLoader.getSystemClassLoader("java/lang/Object.class");
This does not longer work using Jigsaw and I wonder how one is now supposed
to locate a class file. Do I need to find all runtime images and query each
single one? How would the path be for such a class file?
Thank you for your help!
Best regards, Rafael
More information about the jigsaw-dev
mailing list