Simple Patching Tool has been updated with the following enhancement:
- JDK 11 support
Patching java.base module classes in JDK 11 was not supported because of the constraints imposed by the new jigsaw feature. An illegal access error happened when a java.base module class -the one patched- tried to call a method belonging to an unnamed module class –Bridge-. The reason is that java.base module does not declare to read the unnamed module. Note: the unnamed module here belongs to the Bootstrap class loader, as Bridge is loaded from there.
To fix this issue, the instrumenting agent now redefines the java.base module and makes it read the unnamed module from the Bootstrap class loader.
In a future release, we will generalize this trick and make every module read the unnamed module from the Bootstrap class loader.