<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2-rc) on Fri Jun 13 00:14:18 PDT 2003 -->
<TITLE>
Compiler (Java 2 Platform SE v1.4.2)
</TITLE>
<META NAME="keywords" CONTENT="java.lang.Compiler class">
<META NAME="keywords" CONTENT="compileClass()">
<META NAME="keywords" CONTENT="compileClasses()">
<META NAME="keywords" CONTENT="command()">
<META NAME="keywords" CONTENT="enable()">
<META NAME="keywords" CONTENT="disable()">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Compiler (Java 2 Platform SE v1.4.2)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Compiler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/lang/ClassLoader.html" title="class in java.lang"><B>PREV CLASS</B></A>
<A HREF="../../java/lang/Double.html" title="class in java.lang"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Compiler.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.lang</FONT>
<BR>
Class Compiler</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.lang.Compiler</B>
</PRE>
<HR>
<DL>
<DT>public final class <B>Compiler</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></DL>
<P>
The <code>Compiler</code> class is provided to support
Java-to-native-code compilers and related services. By design, the
<code>Compiler</code> class does nothing; it serves as a
placeholder for a JIT compiler implementation.
Compiler类被用来支持Java-本地代码的编译器和相关服务。设计中,Compiler不做任何事,只是充当JIT编译器实现中的占位符。
<p>
When the Java Virtual Machine first starts, it determines if the
system property <code>java.compiler</code> exists. (System
properties are accessible through <code>getProperty</code> and ,
a method defined by the <code>System</code> class.) If so, it is
assumed to be the name of a library (with a platform-dependent
exact location and type); the <code>loadLibrary</code> method in
class <code>System</code> is called to load that library. If this
loading succeeds, the function named
<code>java_lang_Compiler_start()</code> in that library is called.
当Java虚拟机第一次启动时,它先判断系统属性java.compiler是否存在(系统属性通过
System类的getProperty方法访问)。如果存在,它将被假定为一个库名(一个平台无关的确切路径和类型),调用System
的loadLibrary方法加载该库。如果成功加载,调用该库中的java_lang_Compiler_start()方法。
<p>
If no compiler is available, these methods do nothing.
如果没有可用的编译器,这些方法不做任何事。
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>JDK1.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A>,
<A HREF="../../java/lang/System.html#getProperty(java.lang.String, java.lang.String)"><CODE>System.getProperty(java.lang.String, java.lang.String)</CODE></A>,
<A HREF="../../java/lang/System.html#loadLibrary(java.lang.String)"><CODE>System.loadLibrary(java.lang.String)</CODE></A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Compiler.html#command(java.lang.Object)">command</A></B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A> any)</CODE>
<BR>
Examines the argument type and its fields and perform some documented
operation.检查参数类型及其域,并执行某些文档操作。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Compiler.html#compileClass(java.lang.Class)">compileClass</A></B>(<A HREF="../../java/lang/Class.html" title="class in java.lang">Class</A> clazz)</CODE>
<BR>
Compiles the specified class.编译指定的类。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Compiler.html#compileClasses(java.lang.String)">compileClasses</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> string)</CODE>
<BR>
Compiles all classes whose name matches the specified string.编译所有名称和指定字符串相匹配的类。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Compiler.html#disable()">disable</A></B>()</CODE>
<BR>
Cause the Compiler to cease operation.
使Compiler中止运行。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Compiler.html#enable()">enable</A></B>()</CODE>
<BR>
Cause the Compiler to resume operation.
使Compiler恢复运行。</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="compileClass(java.lang.Class)"><!-- --></A><H3>
compileClass</H3>
<PRE>
public static boolean <B>compileClass</B>(<A HREF="../../java/lang/Class.html" title="class in java.lang">Class</A> clazz)</PRE>
<DL>
<DD>Compiles the specified class. 编译指定的类。
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>clazz</CODE> - a class. 类。
<DT><B>Returns:</B><DD><code>true</code> if the compilation succeeded;
<code>false</code> if the compilation failed or no compiler
is available. 如果编译成功,返回true,如果编译失败或者没有可用的编译器返回false。
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>clazz</code> is
<code>null</code>. 如果clazz为null时抛出。</DL>
</DD>
</DL>
<HR>
<A NAME="compileClasses(java.lang.String)"><!-- --></A><H3>
compileClasses</H3>
<PRE>
public static boolean <B>compileClasses</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> string)</PRE>
<DL>
<DD>Compiles all classes whose name matches the specified string.
编译所有名称和指定字符串相匹配的类。
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>string</CODE> - the name of the classes to compile. 用来编译的类名称。
<DT><B>Returns:</B><DD><code>true</code> if the compilation succeeded;
<code>false</code> if the compilation failed or no compiler
is available. 如果编译成功,返回true,如果编译失败或者没有可用的编译器返回false。
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>string</code> is
<code>null</code>. 如果string为null时抛出。</DL>
</DD>
</DL>
<HR>
<A NAME="command(java.lang.Object)"><!-- --></A><H3>
command</H3>
<PRE>
public static <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A> <B>command</B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A> any)</PRE>
<DL>
<DD>Examines the argument type and its fields and perform some documented
operation. No specific operations are required.
检查参数类型及其域,并执行某些文档操作。不需要指定操作。
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>any</CODE> - an argument. 参数。
<DT><B>Returns:</B><DD>a compiler-specific value, or <code>null</code> if no compiler
is available. 编译器指定值,如果没有可用的编译器,为null。
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>any</code> is
<code>null</code>. 如果any为null时抛出。</DL>
</DD>
</DL>
<HR>
<A NAME="enable()"><!-- --></A><H3>
enable</H3>
<PRE>
public static void <B>enable</B>()</PRE>
<DL>
<DD>Cause the Compiler to resume operation. 使Compiler恢复运行。
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="disable()"><!-- --></A><H3>
disable</H3>
<PRE>
public static void <B>disable</B>()</PRE>
<DL>
<DD>Cause the Compiler to cease operation. 使Compiler中止运行。
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Compiler.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/lang/ClassLoader.html" title="class in java.lang"><B>PREV CLASS</B></A>
<A HREF="../../java/lang/Double.html" title="class in java.lang"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Compiler.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>
</BODY>
</HTML>