@bored-art-40741: rewinding to a few days ago, re "On the other hand, shading of the full tool classpath might solve this issue, and I'd be interested in exploring it as a general strategy" - that's in fact the default for the tool shading - given a tool spec and a main class, by default everything except the jdk, the main class and (java visibility rules assumption), everything in the main class' package are shaded. This default aggressive ~complete shading has not worked though for the 2 use cases so far - junit with hamcrest + junit APIs that need to be shared across the tool / user cp, and zinc where the scala APIs need similar sharing. In both cases though the shading excludes could be fine tuned more no doubt and you're free to try that out.