@Override
public Dependency asInstalledDependency() {
final Dependency dep = new Dependency($(toolDistrName) + " installation", $);
CommandLine line = $.sys.line();
Optional<JavaPlugin> java = global.getPlugin(JavaPlugin.class);
if (java.isPresent()) {
try {
line.setVar("JAVA_HOME", $(java.get().homePath));
} catch (Fun.UndefinedException e) {
LoggerFactory.getLogger("log").debug("ignoring JAVA_HOME as the version is not set");
}
}
line.addRaw(createVersionCommandLine());
dep.add(dep.new Command(
line,
new Predicate<CharSequence>() {
@Override