code: public static Class lookupInToolsJar(String pClassName) throws ClassNotFoundException {
          // Try to look up tools.jar within $java.home, otherwise give up
          String extraInfo;
          if (JAVA_HOME != null) {
              extraInfo = "JAVA_HOME is " + JAVA_HOME;
              for (File toolsJar : TOOLS_JAR_LOCATIONS) {
                  try {
                      if (toolsJar.exists()) {
                          ClassLoader loader = createClassLoader(toolsJar);
                          return loader.loadClass(pClassName);
                      }
                  } catch (MalformedURLException e) {
                      // Cannot happen because the URL comes from a File.
                      // And if, we throws an class not found exception.
                      extraInfo = "Cannot create URL from " + toolsJar;
                  }
              }
          } else {
              extraInfo = "No JAVA_HOME set";
          }
          throw new ClassNotFoundException("No tools.jar found (" + extraInfo + ")");
      }
docs: Searches for <code>tools.jar</code> in various locations and uses an {@link URLClassLoader} for
  loading a class from this files. If the class could not be found in any, then a {@link ClassNotFoundException}
  is thrown. The locations used for lookup are (in this order)
  
  <ul>
  <li>$JAVA_HOME/../lib/tools.jar</li>
  <li>$JAVA_HOME/lib/tools.jar</li>
  </ul>
  
  <code>$JAVA_HOME</code> here is the value of the system property <code>java.home</code>
  
  @param pClassName class to lookup
  @return the found class
  @throws ClassNotFoundException if no class could be found