Finding out unused classpath entries

ittai zeidman ittaiz at
Sun Jan 22 06:25:47 UTC 2017

I'm trying to migrate a codebase from a coarse granularity to a finer grain
one. One of the issues is identifying what is actually needed for compile
time for each of the smaller units.
Given that in some cases <>
there is a need for compile time dependencies which don't later appear in
the source or bytecode of the output I'm trying to ascertain if there is a
way for me to know which class-path entries were actually used during a
javac invocation.

My intention is to break the coarse grain module to many smaller ones where
each of the smaller ones depends on the full transitive closure of the
external jars the original module depended on.
My hope is then to run javac with some kind of flag which will allow me to
derive the actual set of class-path entries used for that specific fine
grain module.

It seems I might be able to use -verbose to do this but I'd appreciate
knowing if there is an easier way and if not then a pointer to the
formatting of these messages would also be appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list