code: protected String resolveJava() throws InterruptedException, IOException {
          for (JavaProvider provider : JavaProvider.all()) {
              for (String javaCommand : provider.getJavas(computer, listener, connection)) {
                  LOGGER.fine("Trying Java at " + javaCommand);
                  try {
                      return checkJavaVersion(listener, javaCommand);
                  } catch (IOException e) {
                      LOGGER.log(FINE, "Failed to check the Java version",e);
                      // try the next one
                  }
              }
          }
          throw new IOException("Java not found on " + computer + ". Install a Java 8 version on the Agent.");
      }
docs: return javaPath if specified in the configuration.
  Finds local Java.