本文整理汇总了Java中com.sun.squawk.compiler.Compiler类的典型用法代码示例。如果您正苦于以下问题:Java Compiler类的具体用法?Java Compiler怎么用?Java Compiler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Compiler类属于com.sun.squawk.compiler包,在下文中一共展示了Compiler类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newCompilerPrim
import com.sun.squawk.compiler.Compiler; //导入依赖的package包/类
/**
* Create a new compiler from a class name.
*
* @param compilerClassName the name
* @return the compiler
*/
private static Compiler newCompilerPrim(String compilerClassName) {
try {
Class compilerClass = Class.forName(compilerClassName);
return (Compiler) compilerClass.newInstance();
} catch (Exception e) {
throw new RuntimeException("Could not load and instantiate compiler class " + compilerClassName + " [" + e.getMessage() + "]");
}
}
示例2: newCompiler
import com.sun.squawk.compiler.Compiler; //导入依赖的package包/类
/**
* Create a new default compiler by determining which architecture the VM
* is running on. By default, set it to the X86 architecture.
*
* @return the compiler
*/
public static Compiler newCompiler() {
String arch = "${build.properties:ARCHITECTURE}"; // Will be edited by the romizer
if (arch.endsWith("ARCHITECTURE}")) { // If the code is not romized...
arch = System.getProperty("squawk.architecture");
if (arch == null) {
arch = "X86"; // The platform du jour
}
}
return newCompiler(arch);
}