模块  java.base
软件包  java.lang

Class Compiler


  • @Deprecated(since="9",
                forRemoval=true)
    public final class Compiler
    extends Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    JIT compilers and their technologies vary too widely to be controlled effectively by a standardized interface. As such, many JIT compiler implementations ignore this interface, and are instead controllable by implementation-specific mechanisms such as command-line options. This class is subject to removal in a future version of Java SE.
    提供Compiler类是为了支持Java到本机代码编译器和相关服务。 按照设计, Compiler类什么都不做; 它充当JIT编译器实现的占位符。 如果没有可用的编译器,这些方法什么都不做。
    从以下版本开始:
    1.0
    • 方法摘要

      所有方法  静态方法  具体的方法  弃用的方法 
      变量和类型 方法 描述
      static Object command​(Object any)
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      检查参数类型及其字段并执行一些记录的操作。
      static boolean compileClass​(<?> clazz)
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      编译指定的类。
      static boolean compileClasses​(String string)
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      编译名称与指定字符串匹配的所有类。
      static void disable()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      导致编译器停止运行。
      static void enable()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      导致编译器恢复运行。
    • 方法详细信息

      • compileClass

        public static boolean compileClass​(<?> clazz)
        Deprecated, for removal: This API element is subject to removal in a future version.
        编译指定的类。
        参数
        clazz - 一堂课
        结果
        true如果编译成功; false如果编译失败或没有可用的编译器
        异常
        NullPointerException - 如果 clazznull
      • compileClasses

        public static boolean compileClasses​(String string)
        Deprecated, for removal: This API element is subject to removal in a future version.
        编译名称与指定字符串匹配的所有类。
        参数
        string - 要编译的类的名称
        结果
        true如果编译成功; false如果编译失败或没有可用的编译器
        异常
        NullPointerException - 如果 stringnull
      • command

        public static Object command​(Object any)
        Deprecated, for removal: This API element is subject to removal in a future version.
        检查参数类型及其字段并执行一些记录的操作。 无需特定操作。
        参数
        any - 一个论点
        结果
        特定于编译器的值,如果没有可用的编译器, null
        异常
        NullPointerException - 如果 anynull
      • enable

        public static void enable()
        Deprecated, for removal: This API element is subject to removal in a future version.
        导致编译器恢复运行。
      • disable

        public static void disable()
        Deprecated, for removal: This API element is subject to removal in a future version.
        导致编译器停止运行。