trouble with java -Xpatch

Alan Bateman Alan.Bateman at oracle.com
Mon Apr 4 11:30:20 UTC 2016


On 04/04/2016 12:09, Michael Rasmussen wrote:
> So in order to patch any of the well-known preloaded classes, I will need
> to prepatch them, put them in a folder/jar, and then need to ask the user
> to specify the -Xpatch jvm option, seeing as I don't have the option to
> neither patch them via CFLH, nor add -Xpatch myself from jvmti?
>
As things stand then -Xpatch is the only way to have patched versions of 
the preloaded classes loaded in the primordial phase.

That said, we have enough in place where we could look at allowing 
GetLoadedClasses and RetransformClasses in the start phase. When 
combined with can_generate_early_vmstart then it would allow agents to 
patch classes before any bytecode executes. As per the warnings in the 
spec then any instrumentation at this point requires great care as it's 
still too early in the VM startup for code outside of java.base to execute.

-Alan


More information about the jigsaw-dev mailing list