Module in classpath

Alan Bateman Alan.Bateman at oracle.com
Thu Jun 16 11:46:58 UTC 2016


On 16/06/2016 10:11, Andrew Dinn wrote:
> :
> Ok, so now the bonus question:
>
> Does that mean that it is not possible to implement a Java JVMTI agent
> as Jigsaw modularised code?
>
> I'll add the following to render the question more specific: Clearly,
> you can deploy an agent that links to related code deployed as a
> companion module. I am thinking about the code included in the agent jar
> itself i.e. the one passed to the -javaagent command line argument or to
> the VM_Attach dynamic load API.
>
It not currently possible to deploy a java agent as a module (at least 
not without specifying it twice on the command line). When you run with 
-javaagent or load a java agent into a running VM then the agent is in 
the unnamed module of the application class loader, exactly as before. 
We have of course prototyped agents as modules but there are a number of 
issues, the main being whether there will be augmentation of platform 
modules at runtime when loading an agent into a running VM, and of 
course the question on whether agent configuration should be moved to 
standard class file attributes. JVM TI agents are native libraries but 
since they can arrange for types to become visible at runtime then some 
of the same issues as java agents arise. So I think TBD as whether this 
is this super important to do in the JDK 9 time frame or not.

-Alan.


More information about the jigsaw-dev mailing list