public static JavaCompilerUtil create ( ClassLoader loader ) { JavacConfig config = JavacConfig . getLocalConfig ( ) ; String javac = config . getCompiler ( ) ; JavaCompilerUtil javaCompiler = new JavaCompilerUtil ( ) ; if ( loader == null ) { loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; } javaCompiler . setClassLoader ( loader ) ; javaCompiler . setCompiler ( javac ) ; javaCompiler . setArgs ( config . getArgs ( ) ) ; javaCompiler . setEncoding ( config . getEncoding ( ) ) ; javaCompiler . setMaxBatch ( config . getMaxBatch ( ) ) ; javaCompiler . setStartTimeout ( config . getStartTimeout ( ) ) ; javaCompiler . setMaxCompileTime ( config . getMaxCompileTime ( ) ) ; return javaCompiler ; }
Creates a new compiler .