Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.This code is free software; you can redistribute it and/or modify itunder the terms of the GNU General Public License version 2 only, aspublished by the Free Software Foundation.This code is distributed in the hope that it will be useful, but WITHOUTANY WARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licenseversion 2 for more details (a copy is included in the LICENSE file thataccompanied this code).You should have received a copy of the GNU General Public License version2 along with this work; if not, write to the Free Software Foundation,Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USAor visit www.oracle.com if you need additional information or have anyquestions.DESCRIPTIONThis is replacement for CompileTheWorld (CTW) written on java. Its purpose isto make possible the use of CTW in product builds.DEPENDENCESThe tool depends on Whitebox API. Assumed, that the sources of whitebox arelocated in '../whitebox' directory.BUILDINGSimple way to build, just type 'make'.Makefile uses environment variables 'ALT_BOOTDIR', 'BOOTDIR' as root-dir of jdkthat will be used for compilation and creating jar.On successful building 'ctw.jar' will be created.RUNNINGSince the tool uses WhiteBox API, options 'UnlockDiagnosticVMOptions' and'WhiteBoxAPI' should be specified, and 'wb.jar' should be added toboot-classpath: $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar Arguments can be paths to '.jar, '.zip', '.lst' files or directories withclasses, that define which classes will be compiled: - '.jar', '.zip' files and directories are interpreted like in classpath(including '<dir>/*' syntax) - '.lst' files -- files with class names (in java notation) to compile.CTW will try to find these classes with default class loader, so they shouldbe located in classpath.Without arguments it would work as old version of CTW: all classes inboot-classpath will be compiled, excluding classes in 'rt.jar' if 'rt.jar' isn'tfirst in boot-classpath.Due CTW's flags also are not available in product builds, the tool usesproperties with the same names: - 'CompileTheWorldPreloadClasses' -- type:boolean, default:true, description:Preload all classes used by a class before start loading - 'CompileTheWorldStartAt' -- type:long, default:1, description: First classto consider - 'CompileTheWorldStopAt' -- type:long, default:Long.MAX_VALUE, description:Last class to considerAlso it uses additional properties: - 'sun.hotspot.tools.ctw.verbose' -- type:boolean, default:false,description: Verbose output, adds additional information about compilation - 'sun.hotspot.tools.ctw.logfile' -- type:string, default:null,description: Path to logfile, if it's null, cout will be used.EXAMPLEScompile classes from 'rt.jar': $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ${JAVA_HOME}/jre/lib/rt.jarcompile classes from all '.jar' in './testjars' directory: $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./testjars/*compile classes from './build/classes' directory: $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./build/classescompile only java.lang.String, java.lang.Object classes: $ echo java.lang.String > classes.lst $ echo java.lang.Object >> classes.lst $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar classes.lst