if (_debug) { System.err.println( "Configuring classpath from: " + startConfigFileName ); }
    public Classpath constructClasspath(File homeDir, String[] args) {        // set up classpath:        Classpath _classpath = new Classpath();        // prefill existing paths in classpath_dirs...        if (_debug)            System.out.println("existing classpath = " + System.getProperty("java.class.path"));        _classpath.addClasspath(System.getProperty("java.class.path"));        // add JARs from ext and lib        // be smart about it        try {            InputStream cpcfg = null;            // start.config can be found in two locations.            String configFilePath1 = "";            String configFilePath2 = "";            try {                configFilePath1 = homeDir.getPath() + File.separatorChar                    + "start.config";                cpcfg = new java.io.FileInputStream(configFilePath1);                startConfigFileName = configFilePath1;            } catch (java.io.FileNotFoundException e) {                cpcfg = null;            }            if (cpcfg == null) {                if (_debug)                    System.err.println("Configuring classpath from default resource");                configFilePath2 = "org/exist/start/start.config";                cpcfg = getClass().getClassLoader()                    .getResourceAsStream(configFilePath2);                startConfigFileName = configFilePath2;            }            if (cpcfg == null) {                throw new RuntimeException(                    "start.config not found at "                    + configFilePath1 + " or "                    + configFilePath2 + ", Bailing out."                );            }            configureClasspath(homeDir.getPath(), _classpath, cpcfg, args, _mode);            cpcfg.close();        } catch (IOException e) {            e.printStackTrace();        }        // try to find javac and add it in classpaths        String java_home = System.getProperty("java.home");        if (java_home != null) {            File jdk_home = null;            try {                jdk_home = new File(java_home).getParentFile().getCanonicalFile();            } catch (IOException e) {            }            if (jdk_home != null) {                File tools_jar_file = null;                try {                    tools_jar_file =                            new File(jdk_home, "lib" + File.separator + "tools.jar")                            .getCanonicalFile();                } catch (IOException e) {                }                if ((tools_jar_file != null) && tools_jar_file.isFile()) {                    // OK, found tools.jar in java.home/../lib                    // add it in                    _classpath.addComponent(tools_jar_file);                    if (_debug)                        System.err.println("JAVAC = " + tools_jar_file);                }            }        }        // okay, classpath complete.        System.setProperty("java.class.path", _classpath.toString());        if (_debug)            System.err.println("CLASSPATH=" + _classpath.toString());        return _classpath;    }