FileDocCategorySizeDatePackage
ToolProvider.javaAPI DocJava SE 6 API3668Tue Jun 10 00:27:02 BST 2008javax.tools

ToolProvider

public class ToolProvider extends Object
Provides methods for locating tool providers, for example, providers of compilers. This class complements the functionality of {@link java.util.ServiceLoader}.
author
Peter von der Ahé
since
1.6

Fields Summary
Constructors Summary
private ToolProvider()

Methods Summary
public static javax.tools.JavaCompilergetSystemJavaCompiler()
Gets the Java™ programming language compiler provided with this platform.

return
the compiler provided with this platform or {@code null} if no compiler is provided

        if (Lazy.compilerClass == null)
            return null;
        try {
            return Lazy.compilerClass.newInstance();
        } catch (Throwable e) {
            return null;
        }
    
public static java.lang.ClassLoadergetSystemToolClassLoader()
Returns the class loader for tools provided with this platform. This does not include user-installed tools. Use the {@linkplain java.util.ServiceLoader service provider mechanism} for locating user installed tools.

return
the class loader for tools provided with this platform or {@code null} if no tools are provided

        if (Lazy.compilerClass == null)
            return null;
        return Lazy.compilerClass.getClassLoader();