public final class Compiler extends Object
Compiler类来支持Java到本地代码编译器和相关服务。
按照设计, Compiler课没有做;
它用作JIT编译器实现的占位符。
当Java虚拟机首次启动时,它确定是否存在系统属性java.compiler 。 (系统属性可以通过System.getProperty(String)和System.getProperty(String, String)访问 ,如果是,它被认为是库的名称(具有平台相关的确切位置和类型); 调用System.loadLibrary(java.lang.String)来加载该库,如果此加载成功,则该函数在该库中名为java_lang_Compiler_start() 。
如果没有编译器可用,这些方法什么都不做。
public static boolean compileClass(类<?> clazz)
clazz - 一个班
true如果编译成功;
false如果编译失败或没有编译器可用
NullPointerException - 如果
clazz是
null
public static boolean compileClasses(String string)
string - 要编译的类的名称
true如果编译成功;
false如果编译失败或没有编译器可用
NullPointerException - 如果
string是
null
public static Object command(Object any)
any - 一个争论
null如果没有可用编译器
NullPointerException - 如果
any是
null
public static void enable()
public static void disable()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.