java.lang.Object | +----java.lang.Compiler
Compiler 类主要用来支持 Java 编译器及其相关功能。根据设计,Compiler 类不做任何事;它作为一 JIT 编译器实现的占位符。
当 Java 虚拟机首次运行时,判定系统属性 java.compiler 是否存在。(系统属性可通过 System 类定义的 getProperty
方法访问。)
如果存在,它将被假定为一个库名(与某一平台的确切位置和类型有关);再调用类 System 中的 loadLibrary 方法装载此库。如果装载成功,则调用该库中的名为
java_lang_Compiler_start() 的函数。
如果没有可用的编译器,那么上述这些方法将不被调用。
public static native boolean compileClass(Class clazz)
true,如果编译失败或没有可利用的编译器则为 false。
public static native boolean compileClasses(String string)
true,如果编译失败或没有可利用的编译器则为 false。
public static native Object command(Object any)
null。
public static native void enable()
public static native void disable()