get File Manager for Java Compiler - Java javax.tools

Java examples for javax.tools:JavaCompiler

Description

get File Manager for Java Compiler

Demo Code


import javax.tools.JavaCompiler;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import javax.tools.ToolProvider;

public class Main{
    public static void main(String[] argv) throws Exception{
        System.out.println(getFileManager());
    }/*from   w  ww  . j  ava  2 s  .c o  m*/
    public static JavaFileManager getFileManager() {
        final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        return new ClassFileManager(compiler.getStandardFileManager(null,
                null, null));
    }
}

Related Tutorials