Use NailgunTask's Java distribution consistently.

Review Request #3793 — Created April 30, 2016 and submitted — Latest diff uploaded

benjyw
pants
pants-reviews
jsirois, nhoward_tw, stuhood

A few NailgunTasks need the JDK's tools.jar, and were fetching
its path by going to DistributionLocator, instead of using
the distribution it will later execute with.

In practice, today, these likely end up being the same distribution.
But in the future, if a particular task restricts its choice of
distribution then we could end up running in one JDK with the
tools.jar of another JDK on our classpath. This change prevents
that from happening.

CI passes: https://travis-ci.org/pantsbuild/pants/builds/126825440

Loading...