public JdkCompileTask(JdkCompilerClassLoader classLoader, Iterable<String> options) {
		compiler = ToolProvider.getSystemJavaCompiler();

		if (compiler == null) {
			throw new IllegalStateException("Cannot find the system Java compiler. " + "Check that your class path includes tools.jar");
		}

		this.classLoader = classLoader;
		ClassLoader loader = classLoader.getParent();
		diagnostics = new DiagnosticCollector<JavaFileObject>();
		final StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);

		if (loader instanceof URLClassLoader && (!loader.getClass().getName().equals("sun.misc.Launcher$AppClassLoader"))) {
			try {
				URLClassLoader urlClassLoader = (URLClassLoader) loader;

				List<File> path = new ArrayList<File>();
				for (URL url : urlClassLoader.getURLs()) {
					File file = new File(url.getFile());
					path.add(file);
				}

				fileManager.setLocation(StandardLocation.CLASS_PATH, path);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		javaFileManager = new JavaFileManagerImpl(fileManager, classLoader);
		this.options = new ArrayList<String>();
		if (options != null) { // make a save copy of input options
			for (String option : options) {
				this.options.add(option);
			}
		}
	}