JDK

java.lang.Exceptionクラスのソースコード

java.lang.Exceptionはすべての例外のスーパークラスである。コンストラクタが5種類定義されているだけの簡単なクラスとなっている。しかも,いずれのコンストラクタもスーパークラスであるjava.lang.Throwableクラスのコンストラクタを呼び出す形となっている。

/*
 * Copyright (c) 1994, 2011, 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 it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the “Classpath” exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 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 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package java.lang;

public class Exception extends Throwable {
    public Exception() {
        super();
    }
    public Exception(String message) {
        super(message);
    }
    public Exception(String message, Throwable cause) {
        super(message, cause);
    }
    public Exception(Throwable cause) {
        super(cause);
    }
    protected Exception(String message, Throwable cause,
                        boolean enableSuppression,
                        boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
JDK

java.lang.Systemクラスのソースコード

java.lang.SystemクラスはJavaプログラマなら真っ先に使うクラスと言える。”Hello World”アプリケーションを書いたときに,「System.out.println(“Hello World!”);」と書いたはずだ。このコードの先頭にあるSystemが,java.lang.Systemクラスである。outはjava.lang.Systemクラスの中でpublicフィールドとして, public  static  final  PrintStream  out  =  null; と定義されており,java.io.PrintStream型である。System.inやSystem.errも同様の定義だ。

全体では2000行を超える大きなソースコードであるので,一部を抽出して引用する。

 このほかにSystemクラスの中ではSecurityManagerの設定や,システムプロパティを設定する処理が定義されている。更にJava 9から,ログの設定までjava.lang.Systemクラスの中にインナークラス等として導入されている。ログの扱いは一つのまとまった機能であるので,独立したクラスとした方がよいようにも思えるが,なぜこのような実装になっているのかは不明である。

 後半はシステムの初期化の処理が書かれている。コメントにはJava VMから呼び出されるという趣旨のメッセージが書かれている。Java VMはC言語で書かれているので,そこから直接呼ぶのであろう。

/*
 * Copyright (c) 1994, 2019, 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 it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the “Classpath” exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 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 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */
package java.lang;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.Console;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
import java.lang.module.ModuleDescriptor;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URI;
import java.nio.charset.CharacterCodingException;
import java.security.AccessControlContext;
import java.security.ProtectionDomain;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.nio.channels.Channel;
import java.nio.channels.spi.SelectorProvider;
import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.PropertyPermission;
import java.util.ResourceBundle;
import java.util.function.Supplier;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;

import jdk.internal.util.StaticProperty;
import jdk.internal.module.ModuleBootstrap;
import jdk.internal.module.ServicesCatalog;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.access.JavaLangAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.misc.VM;
import jdk.internal.logger.LoggerFinderLoader;
import jdk.internal.logger.LazyLoggers;
import jdk.internal.logger.LocalizedLoggerWrapper;
import jdk.internal.util.SystemProps;
import jdk.internal.vm.annotation.Stable;
import sun.reflect.annotation.AnnotationType;
import sun.nio.ch.Interruptible;
import sun.security.util.SecurityConstants;

public final class System {
    public static final InputStream in = null;

    public static final PrintStream out = null;

    public static final PrintStream err = null;

    // indicates if a security manager is possible
    private static final int NEVER = 1;
    private static final int MAYBE = 2;
    private static @Stable int allowSecurityManager;

    // current security manager
    private static volatile SecurityManager security;   // read by VM

    // return true if a security manager is allowed
    private static boolean allowSecurityManager() {
        return (allowSecurityManager != NEVER);
    }

    public static void setIn(InputStream in) {
        checkIO();
        setIn0(in);
    }

    public static void setOut(PrintStream out) {
        checkIO();
        setOut0(out);
    }

    public static void setErr(PrintStream err) {
        checkIO();
        setErr0(err);
    }

    private static volatile Console cons;

     public static Console console() {
         Console c;
         if ((c = cons) == null) {
             synchronized (System.class) {
                 if ((c = cons) == null) {
                     cons = c = SharedSecrets.getJavaIOAccess().console();
                 }
             }
         }
         return c;
     }

    private static void checkIO() {
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new RuntimePermission(“setIO”));
        }
    }

    public static void setSecurityManager(SecurityManager sm) {
        if (allowSecurityManager()) {
            if (security == null) {
                // ensure image reader is initialized
                Object.class.getResource(“java/lang/ANY”);
            }
            if (sm != null) {
                try {
                    // pre-populates the SecurityManager.packageAccess cache
                    // to avoid recursive permission checking issues with custom
                    // SecurityManager implementations
                    sm.checkPackageAccess(“java.lang”);
                } catch (Exception e) {
                    // no-op
                }
            }
            setSecurityManager0(sm);
        } else {
            // security manager not allowed
            if (sm != null) {
                throw new UnsupportedOperationException(
                    “Runtime configured to disallow security manager”);
            }
        }
    }

    private static synchronized
    void setSecurityManager0(final SecurityManager s) {
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new RuntimePermission(“setSecurityManager”));
        }

        if ((s != null) && (s.getClass().getClassLoader() != null)) {
            AccessController.doPrivileged(new PrivilegedAction<>() {
                public Object run() {
                    s.getClass().getProtectionDomain().implies
                        (SecurityConstants.ALL_PERMISSION);
                    return null;
                }
            });
        }
        security = s;
    }
    public static SecurityManager getSecurityManager() {
        if (allowSecurityManager()) {
            return security;
        } else {
            return null;
        }
    }
    private static Properties props;

    public static Properties getProperties() {
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPropertiesAccess();
        }
        return props;
    }

    public static String lineSeparator() {
        return lineSeparator;
    }

    private static String lineSeparator;

    public static void setProperties(Properties props) {
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPropertiesAccess();
        }

        if (props == null) {
            Map<String, String> tempProps = SystemProps.initProperties();
            VersionProps.init(tempProps);
            props = createProperties(tempProps);
        }
        System.props = props;
    }

    public static String getProperty(String key) {
        checkKey(key);
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPropertyAccess(key);
        }

        return props.getProperty(key);
    }

    public static String getProperty(String key, String def) {
        checkKey(key);
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPropertyAccess(key);
        }

        return props.getProperty(key, def);
    }

    public static String setProperty(String key, String value) {
        checkKey(key);
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new PropertyPermission(key,
                SecurityConstants.PROPERTY_WRITE_ACTION));
        }

        return (String) props.setProperty(key, value);
    }

    public static String clearProperty(String key) {
        checkKey(key);
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new PropertyPermission(key, “write”));
        }

        return (String) props.remove(key);
    }

    private static void checkKey(String key) {
        if (key == null) {
            throw new NullPointerException(“key can’t be null”);
        }
        if (key.isEmpty()) {
            throw new IllegalArgumentException(“key can’t be empty”);
        }
    }

    public static String getenv(String name) {
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new RuntimePermission(“getenv.”+name));
        }
        return ProcessEnvironment.getenv(name);
    }


    public static java.util.Map<String,String> getenv() {
        SecurityManager sm = getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new RuntimePermission(“getenv.*”));
        }
        return ProcessEnvironment.getenv();
    }

    public interface Logger {
        // 省略
    }
    public static abstract class LoggerFinder {
        //省略
    }
    @CallerSensitive
    public static Logger getLogger(String name) {
        Objects.requireNonNull(name);
        final Class<?> caller = Reflection.getCallerClass();
        if (caller == null) {
            throw new IllegalCallerException(“no caller frame”);
        }
        return LazyLoggers.getLogger(name, caller.getModule());
    }
    @CallerSensitive
    public static Logger getLogger(String name, ResourceBundle bundle) {
        final ResourceBundle rb = Objects.requireNonNull(bundle);
        Objects.requireNonNull(name);
        final Class<?> caller = Reflection.getCallerClass();
        if (caller == null) {
            throw new IllegalCallerException(“no caller frame”);
        }
        final SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            final PrivilegedAction<Logger> pa =
                    () -> LoggerFinder.accessProvider()
                            .getLocalizedLogger(name, rb, caller.getModule());
            return AccessController.doPrivileged(pa, null,
                                         LoggerFinder.LOGGERFINDER_PERMISSION);
        }
        return LoggerFinder.accessProvider()
                .getLocalizedLogger(name, rb, caller.getModule());
    }
    public static void exit(int status) {
        Runtime.getRuntime().exit(status);
    }
    public static void gc() {
        Runtime.getRuntime().gc();
    }
    public static void runFinalization() {
        Runtime.getRuntime().runFinalization();
    }
    @CallerSensitive
    public static void load(String filename) {
        Runtime.getRuntime().load0(Reflection.getCallerClass(), filename);
    }
    @CallerSensitive
    public static void loadLibrary(String libname) {
        Runtime.getRuntime().loadLibrary0(Reflection.getCallerClass(), libname);
    }
    public static native String mapLibraryName(String libname);
    private static PrintStream newPrintStream(FileOutputStream fos, String enc) {
       if (enc != null) {
            try {
                return new PrintStream(new BufferedOutputStream(fos, 128), true, enc);
            } catch (UnsupportedEncodingException uee) {}
        }
        return new PrintStream(new BufferedOutputStream(fos, 128), true);
    }
    private static void logInitException(boolean printToStderr,
                                         boolean printStackTrace,
                                         String msg,
                                         Throwable e) {
        if (VM.initLevel() < 1) {
            throw new InternalError(“system classes not initialized”);
        }
        PrintStream log = (printToStderr) ? err : out;
        if (msg != null) {
            log.println(msg);
        }
        if (printStackTrace) {
            e.printStackTrace(log);
        } else {
            log.println(e);
            for (Throwable suppressed : e.getSuppressed()) {
                log.println(“Suppressed: ” + suppressed);
            }
            Throwable cause = e.getCause();
            if (cause != null) {
                log.println(“Caused by: ” + cause);
            }
        }
    }
    private static Properties createProperties(Map<String, String> initialProps) {
        Properties properties = new Properties(initialProps.size());
        for (var entry : initialProps.entrySet()) {
            String prop = entry.getKey();
            switch (prop) {
                // Do not add private system properties to the Properties
                case “sun.nio.MaxDirectMemorySize”:
                case “sun.nio.PageAlignDirectMemory”:
                    // used by java.lang.Integer.IntegerCache
                case “java.lang.Integer.IntegerCache.high”:
                    // used by sun.launcher.LauncherHelper
                case “sun.java.launcher.diag”:
                    // used by jdk.internal.loader.ClassLoaders
                case “jdk.boot.class.path.append”:
                    break;
                default:
                    properties.put(prop, entry.getValue());
            }
        }
        return properties;
    }
    private static void initPhase1() {
        // VM might invoke JNU_NewStringPlatform() to set those encoding
        // sensitive properties (user.home, user.name, boot.class.path, etc.)
        // during “props” initialization.
        // The charset is initialized in System.c and does not depend on the Properties.
        Map<String, String> tempProps = SystemProps.initProperties();
        VersionProps.init(tempProps);

        // There are certain system configurations that may be controlled by
        // VM options such as the maximum amount of direct memory and
        // Integer cache size used to support the object identity semantics
        // of autoboxing.  Typically, the library will obtain these values
        // from the properties set by the VM.  If the properties are for
        // internal implementation use only, these properties should be
        // masked from the system properties.
        //
        // Save a private copy of the system properties object that
        // can only be accessed by the internal implementation.
        VM.saveProperties(tempProps);
        props = createProperties(tempProps);

        StaticProperty.javaHome();          // Load StaticProperty to cache the property values

        lineSeparator = props.getProperty(“line.separator”);

        FileInputStream fdIn = new FileInputStream(FileDescriptor.in);
        FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
        FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
        setIn0(new BufferedInputStream(fdIn));
        setOut0(newPrintStream(fdOut, props.getProperty(“sun.stdout.encoding”)));
        setErr0(newPrintStream(fdErr, props.getProperty(“sun.stderr.encoding”)));

        // Setup Java signal handlers for HUP, TERM, and INT (where available).
        Terminator.setup();

        // Initialize any miscellaneous operating system settings that need to be
        // set for the class libraries. Currently this is no-op everywhere except
        // for Windows where the process-wide error mode is set before the java.io
        // classes are used.
        VM.initializeOSEnvironment();

        // The main thread is not added to its thread group in the same
        // way as other threads; we must do it ourselves here.
        Thread current = Thread.currentThread();
        current.getThreadGroup().add(current);

        // register shared secrets
        setJavaLangAccess();

        // Subsystems that are invoked during initialization can invoke
        // VM.isBooted() in order to avoid doing things that should
        // wait until the VM is fully initialized. The initialization level
        // is incremented from 0 to 1 here to indicate the first phase of
        // initialization has completed.
        // IMPORTANT: Ensure that this remains the last initialization action!
        VM.initLevel(1);
    }

    // @see #initPhase2()
    static ModuleLayer bootLayer;

    /*
     * Invoked by VM.  Phase 2 module system initialization.
     * Only classes in java.base can be loaded in this phase.
     *
     * @param printToStderr print exceptions to stderr rather than stdout
     * @param printStackTrace print stack trace when exception occurs
     *
     * @return JNI_OK for success, JNI_ERR for failure
     */
    private static int initPhase2(boolean printToStderr, boolean printStackTrace) {
        try {
            bootLayer = ModuleBootstrap.boot();
        } catch (Exception | Error e) {
            logInitException(printToStderr, printStackTrace,
                             “Error occurred during initialization of boot layer”, e);
            return -1; // JNI_ERR
        }

        // module system initialized
        VM.initLevel(2);

        return 0; // JNI_OK
    }

    /*
     * Invoked by VM.  Phase 3 is the final system initialization:
     * 1. set security manager
     * 2. set system class loader
     * 3. set TCCL
     *
     * This method must be called after the module system initialization.
     * The security manager and system class loader may be a custom class from
     * the application classpath or modulepath.
     */
    private static void initPhase3() {
        String smProp = System.getProperty(“java.security.manager”);
        if (smProp != null) {
            switch (smProp) {
                case “disallow”:
                    allowSecurityManager = NEVER;
                    break;
                case “allow”:
                    allowSecurityManager = MAYBE;
                    break;
                case “”:
                case “default”:
                    setSecurityManager(new SecurityManager());
                    allowSecurityManager = MAYBE;
                    break;
                default:
                    try {
                        ClassLoader cl = ClassLoader.getBuiltinAppClassLoader();
                        Class<?> c = Class.forName(smProp, false, cl);
                        Constructor<?> ctor = c.getConstructor();
                        // Must be a public subclass of SecurityManager with
                        // a public no-arg constructor
                        if (!SecurityManager.class.isAssignableFrom(c) ||
                            !Modifier.isPublic(c.getModifiers()) ||
                            !Modifier.isPublic(ctor.getModifiers())) {
                            throw new Error(“Could not create SecurityManager: “
                                             + ctor.toString());
                        }
                        // custom security manager may be in non-exported package
                        ctor.setAccessible(true);
                        SecurityManager sm = (SecurityManager) ctor.newInstance();
                        setSecurityManager(sm);
                    } catch (Exception e) {
                        throw new InternalError(“Could not create SecurityManager”, e);
                    }
                    allowSecurityManager = MAYBE;
            }
        } else {
            allowSecurityManager = MAYBE;
        }

        // initializing the system class loader
        VM.initLevel(3);

        // system class loader initialized
        ClassLoader scl = ClassLoader.initSystemClassLoader();

        // set TCCL
        Thread.currentThread().setContextClassLoader(scl);

        // system is fully initialized
        VM.initLevel(4);
    }

    private static void setJavaLangAccess() {
        // Allow privileged classes outside of java.lang
        SharedSecrets.setJavaLangAccess(new JavaLangAccess() {
            public List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>… parameterTypes) {
                return klass.getDeclaredPublicMethods(name, parameterTypes);
            }
            public jdk.internal.reflect.ConstantPool getConstantPool(Class<?> klass) {
                return klass.getConstantPool();
            }
            public boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType) {
                return klass.casAnnotationType(oldType, newType);
            }
            public AnnotationType getAnnotationType(Class<?> klass) {
                return klass.getAnnotationType();
            }
            public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass) {
                return klass.getDeclaredAnnotationMap();
            }
            public byte[] getRawClassAnnotations(Class<?> klass) {
                return klass.getRawAnnotations();
            }
            public byte[] getRawClassTypeAnnotations(Class<?> klass) {
                return klass.getRawTypeAnnotations();
            }
            public byte[] getRawExecutableTypeAnnotations(Executable executable) {
                return Class.getExecutableTypeAnnotationBytes(executable);
            }
            public <E extends Enum<E>>
            E[] getEnumConstantsShared(Class<E> klass) {
                return klass.getEnumConstantsShared();
            }
            public void blockedOn(Interruptible b) {
                Thread.blockedOn(b);
            }
            public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook) {
                Shutdown.add(slot, registerShutdownInProgress, hook);
            }
            public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) {
                return new Thread(target, acc);
            }
            @SuppressWarnings(“deprecation”)
            public void invokeFinalize(Object o) throws Throwable {
                o.finalize();
            }
            public ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl) {
                return cl.createOrGetClassLoaderValueMap();
            }
            public Class<?> defineClass(ClassLoader loader, String name, byte[] b, ProtectionDomain pd, String source) {
                return ClassLoader.defineClass1(loader, name, b, 0, b.length, pd, source);
            }
            public Class<?> findBootstrapClassOrNull(ClassLoader cl, String name) {
                return cl.findBootstrapClassOrNull(name);
            }
            public Package definePackage(ClassLoader cl, String name, Module module) {
                return cl.definePackage(name, module);
            }
            public String fastUUID(long lsb, long msb) {
                return Long.fastUUID(lsb, msb);
            }
            public void addNonExportedPackages(ModuleLayer layer) {
                SecurityManager.addNonExportedPackages(layer);
            }
            public void invalidatePackageAccessCache() {
                SecurityManager.invalidatePackageAccessCache();
            }
            public Module defineModule(ClassLoader loader,
                                       ModuleDescriptor descriptor,
                                       URI uri) {
                return new Module(null, loader, descriptor, uri);
            }
            public Module defineUnnamedModule(ClassLoader loader) {
                return new Module(loader);
            }
            public void addReads(Module m1, Module m2) {
                m1.implAddReads(m2);
            }
            public void addReadsAllUnnamed(Module m) {
                m.implAddReadsAllUnnamed();
            }
            public void addExports(Module m, String pn, Module other) {
                m.implAddExports(pn, other);
            }
            public void addExportsToAllUnnamed(Module m, String pn) {
                m.implAddExportsToAllUnnamed(pn);
            }
            public void addOpens(Module m, String pn, Module other) {
                m.implAddOpens(pn, other);
            }
            public void addOpensToAllUnnamed(Module m, String pn) {
                m.implAddOpensToAllUnnamed(pn);
            }
            public void addOpensToAllUnnamed(Module m, Iterator<String> packages) {
                m.implAddOpensToAllUnnamed(packages);
            }
            public void addUses(Module m, Class<?> service) {
                m.implAddUses(service);
            }
            public boolean isReflectivelyExported(Module m, String pn, Module other) {
                return m.isReflectivelyExported(pn, other);
            }
            public boolean isReflectivelyOpened(Module m, String pn, Module other) {
                return m.isReflectivelyOpened(pn, other);
            }
            public ServicesCatalog getServicesCatalog(ModuleLayer layer) {
                return layer.getServicesCatalog();
            }
            public Stream<ModuleLayer> layers(ModuleLayer layer) {
                return layer.layers();
            }
            public Stream<ModuleLayer> layers(ClassLoader loader) {
                return ModuleLayer.layers(loader);
            }

            public String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException  {
                return StringCoding.newStringNoRepl(bytes, cs);
            }

            public byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException {
                return StringCoding.getBytesNoRepl(s, cs);
            }

            public String newStringUTF8NoRepl(byte[] bytes, int off, int len) {
                return StringCoding.newStringUTF8NoRepl(bytes, off, len);
            }

            public byte[] getBytesUTF8NoRepl(String s) {
                return StringCoding.getBytesUTF8NoRepl(s);
            }

            public void setCause(Throwable t, Throwable cause) {
                t.setCause(cause);
            }
        });
    }
}
JDK

java.lang.Byteクラスのソースコード

java.lang.Byteクラスはプリミティブ型のbyteのラッパークラスである。最大値,最小値を表すMIN_VALUEとMAX_VALUEはそれぞれリテラルで127,-128と書かれている。

値はbyte型のprivateフィールド valueに保持するよう定義されている。 static initializerですべての値のインスタンスを作成してキャッシュを保持していることがわかる。

decode()メソッドは,Integerクラスのdecode()メソッドを呼び出して,Byte型の範囲であればbyte型にキャスト,Byte型の範囲外の場合はNumberFormatExceptionをスローするようになっている。

shortValue(),intValue(),longValue(),floatValue(),doubleValue()メソッドは,プリミティブ型のbyte値をそれぞれの型へキャストしているだけである。

equals(Object)メソッドは他のクラスと比べるととても簡単である。Byteクラスのインスタンスであれば,==演算子で一致した場合のみtrueを返している。キャッシュを使って同じ値であれば同じオブジェクトを使うように実装されているため,このような比較が可能になっている。

/*
 * Copyright (c) 1996, 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 it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the “Classpath” exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 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 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package java.lang;

import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.VM;

/**
 *
 * The {@code Byte} class wraps a value of primitive type {@code byte}
 * in an object.  An object of type {@code Byte} contains a single
 * field whose type is {@code byte}.
 *
 * <p>In addition, this class provides several methods for converting
 * a {@code byte} to a {@code String} and a {@code String} to a {@code
 * byte}, as well as other constants and methods useful when dealing
 * with a {@code byte}.
 *
 * @author  Nakul Saraiya
 * @author  Joseph D. Darcy
 * @see     java.lang.Number
 * @since   1.1
 */
public final class Byte extends Number implements Comparable<Byte> {

    public static final byte   MIN_VALUE = -128;

    public static final byte   MAX_VALUE = 127;

    @SuppressWarnings(“unchecked”)
    public static final Class<Byte>     TYPE = (Class<Byte>) Class.getPrimitiveClass(“byte”);

    public static String toString(byte b) {
        return Integer.toString((int)b, 10);
    }

    private static class ByteCache {
        private ByteCache() {}

        static final Byte[] cache;
        static Byte[] archivedCache;

        static {
            final int size = -(-128) + 127 + 1;

            // Load and use the archived cache if it exists
            VM.initializeFromArchive(ByteCache.class);
            if (archivedCache == null || archivedCache.length != size) {
                Byte[] c = new Byte[size];
                byte value = (byte)-128;
                for(int i = 0; i < size; i++) {
                    c[i] = new Byte(value++);
                }
                archivedCache = c;
            }
            cache = archivedCache;
        }
    }

    @HotSpotIntrinsicCandidate
    public static Byte valueOf(byte b) {
        final int offset = 128;
        return ByteCache.cache[(int)b + offset];
    }

    public static byte parseByte(String s, int radix)
        throws NumberFormatException {
        int i = Integer.parseInt(s, radix);
        if (i < MIN_VALUE || i > MAX_VALUE)
            throw new NumberFormatException(
                “Value out of range. Value:\”” + s + “\” Radix:” + radix);
        return (byte)i;
    }

    public static byte parseByte(String s) throws NumberFormatException {
        return parseByte(s, 10);
    }

    public static Byte valueOf(String s, int radix)
        throws NumberFormatException {
        return valueOf(parseByte(s, radix));
    }

    public static Byte valueOf(String s) throws NumberFormatException {
        return valueOf(s, 10);
    }

    public static Byte decode(String nm) throws NumberFormatException {
        int i = Integer.decode(nm);
        if (i < MIN_VALUE || i > MAX_VALUE)
            throw new NumberFormatException(
                    “Value ” + i + ” out of range from input ” + nm);
        return valueOf((byte)i);
    }

    private final byte value;

    @HotSpotIntrinsicCandidate
    public byte byteValue() {
        return value;
    }

    public short shortValue() {
        return (short)value;
    }

    public int intValue() {
        return (int)value;
    }
    
    public long longValue() {
        return (long)value;
    }

    public float floatValue() {
        return (float)value;
    }

    public double doubleValue() {
        return (double)value;
    }

    public String toString() {
        return Integer.toString((int)value);
    }

    @Override
    public int hashCode() {
        return Byte.hashCode(value);
    }

    public static int hashCode(byte value) {
        return (int)value;
    }

    public boolean equals(Object obj) {
        if (obj instanceof Byte) {
            return value == ((Byte)obj).byteValue();
        }
        return false;
    }

    public int compareTo(Byte anotherByte) {
        return compare(this.value, anotherByte.value);
    }

    public static int compare(byte x, byte y) {
        return x – y;
    }

    public static int compareUnsigned(byte x, byte y) {
        return Byte.toUnsignedInt(x) – Byte.toUnsignedInt(y);
    }

    public static int toUnsignedInt(byte x) {
        return ((int) x) & 0xff;
    }

    public static long toUnsignedLong(byte x) {
        return ((long) x) & 0xffL;
    }

    public static final int SIZE = 8;

    public static final int BYTES = SIZE / Byte.SIZE;
}
JDK

java.lang.AutoCloseableインタフェース

Java 7から導入されたtry-with-resourceで使うためのAutoCloseableインタフェースである。内容は極めて簡単なインタフェースであり,close()メソッドが定義されているだけである。

package java.lang;
public interface AutoCloseable {
    /**
     * Closes this resource, relinquishing any underlying resources.
     * This method is invoked automatically on objects managed by the
     * {@code try}-with-resources statement.
     *
     * <p>While this interface method is declared to throw {@code
     * Exception}, implementers are <em>strongly</em> encouraged to
     * declare concrete implementations of the {@code close} method to
     * throw more specific exceptions, or to throw no exception at all
     * if the close operation cannot fail.
     *
     * <p> Cases where the close operation may fail require careful
     * attention by implementers. It is strongly advised to relinquish
     * the underlying resources and to internally <em>mark</em> the
     * resource as closed, prior to throwing the exception. The {@code
     * close} method is unlikely to be invoked more than once and so
     * this ensures that the resources are released in a timely manner.
     * Furthermore it reduces problems that could arise when the resource
     * wraps, or is wrapped, by another resource.
     *
     * <p><em>Implementers of this interface are also strongly advised
     * to not have the {@code close} method throw {@link
     * InterruptedException}.</em>
     *
     * This exception interacts with a thread’s interrupted status,
     * and runtime misbehavior is likely to occur if an {@code
     * InterruptedException} is {@linkplain Throwable#addSuppressed
     * suppressed}.
     *
     * More generally, if it would cause problems for an
     * exception to be suppressed, the {@code AutoCloseable.close}
     * method should not throw it.
     *
     * <p>Note that unlike the {@link java.io.Closeable#close close}
     * method of {@link java.io.Closeable}, this {@code close} method
     * is <em>not</em> required to be idempotent.  In other words,
     * calling this {@code close} method more than once may have some
     * visible side effect, unlike {@code Closeable.close} which is
     * required to have no effect if called more than once.
     *
     * However, implementers of this interface are strongly encouraged
     * to make their {@code close} methods idempotent.
     *
     * @throws Exception if this resource cannot be closed
     */
    void close() throws Exception;
}
JDK

java.lang.NullPointerExceptionのソースコード

 今回は悪名高き,NullPointerExceptionクラスのソースコードを見てみよう。「悪名高い」といっても,このソースコードが悪いわけではない。NullPointerException (NPE)が起こるようなプログラムを書く方が悪いのは言うまでもない。

/*
 * Copyright (c) 1994, 2011, 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 it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the “Classpath” exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 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 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package java.lang;

/**
 * Thrown when an application attempts to use {@code null} in a
 * case where an object is required. These include:
 * <ul>
 * <li>Calling the instance method of a {@code null} object.
 * <li>Accessing or modifying the field of a {@code null} object.
 * <li>Taking the length of {@code null} as if it were an array.
 * <li>Accessing or modifying the slots of {@code null} as if it
 *     were an array.
 * <li>Throwing {@code null} as if it were a {@code Throwable}
 *     value.
 * </ul>
 * <p>
 * Applications should throw instances of this class to indicate
 * other illegal uses of the {@code null} object.
 *
 * {@code NullPointerException} objects may be constructed by the
 * virtual machine as if {@linkplain Throwable#Throwable(String,
 * Throwable, boolean, boolean) suppression were disabled and/or the
 * stack trace was not writable}.
 *
 * @author  unascribed
 * @since   1.0
 */
public
class NullPointerException extends RuntimeException {
    private static final long serialVersionUID = 5162710183389028792L;

    /**
     * Constructs a {@code NullPointerException} with no detail message.
     */
    public NullPointerException() {
        super();
    }

    /**
     * Constructs a {@code NullPointerException} with the specified
     * detail message.
     *
     * @param   s   the detail message.
     */
    public NullPointerException(String s) {
        super(s);
    }
}

一目瞭然であるが,とても単純な構造である。RuntimeExceptionを継承しており,コンストラクタが2つ定義されているだけである。そして,これらのコンストラクタも,同じ引数をとるスーパークラスのコンストラクタを呼び出しているだけだ。

JDK

java.lang.Stringのソースコードを読む

OpenJDK 13に含まれるjava.lang.Stringクラスのソースコードは3500行近いサイズの巨大なものになっている。とても全部は照会できないので,主要な部分だけ抜粋しよう。

java.lang.Stringクラスのソースコードから主な部分を抜粋してみた。文字列の値はvalueというbyte[]配列で保持されていることがわかる。corderはLATIN1とUTF16という定数値のいずれかが設定される。

 ディフォルトコンストラクタでは,このvalueとcorderに空文字列のこれらの値を設定している。ASCIIコード系システムの場合は1byteで処理するようになっているようだ。多くのコンストラクタが定義されているが,いずれもこれらの値を求めて設定しているいすぎない。

 isEmpty()メソッドは,value配列が長さが0かどうかで判定していることがわかる。

 getBytes()メソッドでは,文字列をエンコーディングに従ってbyte[]型に変換する。StringCodingクラスのstaticメソッドencode()を呼び出している。

public final class String
    implements java.io.Serializable, Comparable<String>, CharSequence,
               Constable, ConstantDesc {

    @Stable
    private final byte[] value;

    private final byte coder;

    private int hash; // Default to 0

    private boolean hashIsZero; // Default to false;

    public String() {
        this.value = “”.value;
        this.coder = “”.coder;
    }
    public String(char value[], int offset, int count) {
        this(value, offset, count, rangeCheck(value, offset, count));
    }

    private static Void rangeCheck(char[] value, int offset, int count) {
        checkBoundsOffCount(offset, count, value.length);
        return null;
    }
    public String(byte bytes[], int offset, int length, Charset charset) {
        if (charset == null)
            throw new NullPointerException(“charset”);
        checkBoundsOffCount(offset, length, bytes.length);
        StringCoding.Result ret =
            StringCoding.decode(charset, bytes, offset, length);
        this.value = ret.value;
        this.coder = ret.coder;
    }
    public int length() {
        return value.length >> coder();
    }
    public boolean isEmpty() {
        return value.length == 0;
    }
    public char charAt(int index) {
        if (isLatin1()) {
            return StringLatin1.charAt(value, index);
        } else {
            return StringUTF16.charAt(value, index);
        }
    }
    public byte[] getBytes(String charsetName)
            throws UnsupportedEncodingException {
        if (charsetName == null) throw new NullPointerException();
        return StringCoding.encode(charsetName, coder(), value);
    }
    public byte[] getBytes(Charset charset) {
        if (charset == null) throw new NullPointerException();
        return StringCoding.encode(charset, coder(), value);
     }
    public boolean equals(Object anObject) {
        if (this == anObject) {
            return true;
        }
        if (anObject instanceof String) {
            String aString = (String)anObject;
            if (!COMPACT_STRINGS || this.coder == aString.coder) {
                return StringLatin1.equals(value, aString.value);
            }
        }
        return false;
    }
    public int compareTo(String anotherString) {
        byte v1[] = value;
        byte v2[] = anotherString.value;
        byte coder = coder();
        if (coder == anotherString.coder()) {
            return coder == LATIN1 ? StringLatin1.compareTo(v1, v2)
                                   : StringUTF16.compareTo(v1, v2);
        }
        return coder == LATIN1 ? StringLatin1.compareToUTF16(v1, v2)
                               : StringUTF16.compareToLatin1(v1, v2);
     }
    public boolean startsWith(String prefix, int toffset) {
        // Note: toffset might be near -1>>>1.
        if (toffset < 0 || toffset > length() – prefix.length()) {
            return false;
        }
        byte ta[] = value;
        byte pa[] = prefix.value;
        int po = 0;
        int pc = pa.length;
        byte coder = coder();
        if (coder == prefix.coder()) {
            int to = (coder == LATIN1) ? toffset : toffset << 1;
            while (po < pc) {
                if (ta[to++] != pa[po++]) {
                    return false;
                }
            }
        } else {
            if (coder == LATIN1) {  // && pcoder == UTF16
                return false;
            }
            // coder == UTF16 && pcoder == LATIN1)
            while (po < pc) {
                if (StringUTF16.getChar(ta, toffset++) != (pa[po++] & 0xff)) {
                    return false;
               }
            }
        }
        return true;
    }
    public boolean startsWith(String prefix) {
        return startsWith(prefix, 0);
    }
    public int hashCode() {
        // The hash or hashIsZero fields are subject to a benign data race,
        // making it crucial to ensure that any observable result of the
        // calculation in this method stays correct under any possible read of
        // these fields. Necessary restrictions to allow this to be correct
        // without explicit memory fences or similar concurrency primitives is
        // that we can ever only write to one of these two fields for a given
        // String instance, and that the computation is idempotent and derived
        // from immutable state
        int h = hash;
        if (h == 0 && !hashIsZero) {
            h = isLatin1() ? StringLatin1.hashCode(value)
                           : StringUTF16.hashCode(value);
            if (h == 0) {
                hashIsZero = true;
            } else {
                hash = h;
            }
        }
        return h;
    }
    public String substring(int beginIndex, int endIndex) {
        int length = length();
        checkBoundsBeginEnd(beginIndex, endIndex, length);
        int subLen = endIndex – beginIndex;
        if (beginIndex == 0 && endIndex == length) {
            return this;
        }
        return isLatin1() ? StringLatin1.newString(value, beginIndex, subLen)
                          : StringUTF16.newString(value, beginIndex, subLen);
    }
    public String replace(char oldChar, char newChar) {
        if (oldChar != newChar) {
            String ret = isLatin1() ? StringLatin1.replace(value, oldChar, newChar)
                                    : StringUTF16.replace(value, oldChar, newChar);
            if (ret != null) {
                return ret;
            }
        }
        return this;
    }
    public boolean matches(String regex) {
        return Pattern.matches(regex, this);
    }
    public String replaceAll(String regex, String replacement) {
        return Pattern.compile(regex).matcher(this).replaceAll(replacement);
    }
    public String[] split(String regex, int limit) {
        /* fastpath if the regex is a
         (1)one-char String and this character is not one of the
            RegEx’s meta characters “.$|()[{^?*+\\”, or
         (2)two-char String and the first char is the backslash and
            the second is not the ascii digit or ascii letter.
         */
        char ch = 0;
        if (((regex.length() == 1 &&
             “.$|()[{^?*+\\”.indexOf(ch = regex.charAt(0)) == -1) ||
             (regex.length() == 2 &&
              regex.charAt(0) == ‘\\’ &&
              (((ch = regex.charAt(1))-‘0’)|(‘9’-ch)) < 0 &&
              ((ch-‘a’)|(‘z’-ch)) < 0 &&
              ((ch-‘A’)|(‘Z’-ch)) < 0)) &&
            (ch < Character.MIN_HIGH_SURROGATE ||
             ch > Character.MAX_LOW_SURROGATE))
        {
            int off = 0;
            int next = 0;
            boolean limited = limit > 0;
            ArrayList<String> list = new ArrayList<>();
            while ((next = indexOf(ch, off)) != -1) {
                if (!limited || list.size() < limit – 1) {
                    list.add(substring(off, next));
                    off = next + 1;
                } else {    // last one
                    //assert (list.size() == limit – 1);
                    int last = length();
                    list.add(substring(off, last));
                    off = last;
                    break;
                }
            }
            // If no match was found, return this
            if (off == 0)
                return new String[]{this};

            // Add remaining segment
            if (!limited || list.size() < limit)
                list.add(substring(off, length()));

            // Construct result
            int resultSize = list.size();
            if (limit == 0) {
                while (resultSize > 0 && list.get(resultSize – 1).isEmpty()) {
                    resultSize–;
                }
            }
            String[] result = new String[resultSize];
            return list.subList(0, resultSize).toArray(result);
        }
        return Pattern.compile(regex).split(this, limit);
    }
    public static String valueOf(boolean b) {
        return b ? “true” : “false”;
    }
    public static String valueOf(int i) {
        return Integer.toString(i);
    }
}

未分類

OpenJDK 13(開発中)をビルド

OpenJDK 13(開発中,2019年9月リリース予定)のソースコードをダウンロードして,ビルドしてみました。時間帯によっては回線が不安定で,Mercurialリポジトリからソースコードをチェックアウトに失敗しました。早朝にようやくチェックアウトができたので,さっそくビルドしました。


ソースコードをチェックアウト
ビルドして動作確認

[kubo@kubo-centos7 openjdk13]$ cd jdk
[kubo@kubo-centos7 jdk]$ ls
ADDITIONAL_LICENSE_INFO LICENSE README configure make test
ASSEMBLY_EXCEPTION Makefile bin doc src
[kubo@kubo-centos7 jdk]$ bash configure
Runnable configure script is not present
Generating runnable configure script at /home/kubo/openjdk/openjdk13/jdk/build/.configure-support/generated-configure.sh
Using autoconf at /bin/autoconf [autoconf (GNU Autoconf) 2.69]
configure: Configuration created at Wed May 1 06:22:34 JST 2019.
checking for basename… /bin/basename
checking for bash… /bin/bash
checking for cat… /bin/cat
checking for chmod… /bin/chmod
checking for cmp… /bin/cmp
checking for comm… /bin/comm
checking for cp… /bin/cp
checking for cut… /bin/cut
checking for date… /bin/date
checking for gdiff… no
checking for diff… /bin/diff
checking for dirname… /bin/dirname
checking for echo… /bin/echo
checking for expr… /bin/expr
checking for file… /bin/file
checking for find… /bin/find
checking for head… /bin/head
checking for gunzip… /bin/gunzip
checking for pigz… no
checking for gzip… /bin/gzip
checking for ln… /bin/ln
checking for ls… /bin/ls
checking for gmkdir… no
checking for mkdir… /bin/mkdir
checking for mktemp… /bin/mktemp
checking for mv… /bin/mv
checking for nawk… no
checking for gawk… /bin/gawk
checking for printf… /bin/printf
checking for greadlink… no
checking for readlink… /bin/readlink
checking for rm… /bin/rm
checking for rmdir… /bin/rmdir
checking for sh… /bin/sh
checking for sort… /bin/sort
checking for tail… /bin/tail
checking for gtar… /bin/gtar
checking for tee… /bin/tee
checking for touch… /bin/touch
checking for tr… /bin/tr
checking for uname… /bin/uname
checking for uniq… /bin/uniq
checking for wc… /bin/wc
checking for which… /bin/which
checking for xargs… /bin/xargs
checking for gawk… gawk
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for fgrep… /bin/grep -F
checking for a sed that does not truncate output… /bin/sed
checking for cygpath… no
checking for wslpath… no
checking for df… /bin/df
checking for cpio… /bin/cpio
checking for nice… /bin/nice
checking for lsb_release… no
checking for cmd.exe… no
checking for /mnt/c/Windows/System32/cmd.exe… no
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
checking target system type… x86_64-unknown-linux-gnu
checking openjdk-build os-cpu… linux-x86_64
checking openjdk-target os-cpu… linux-x86_64
checking compilation type… native
checking for top-level directory… /home/kubo/openjdk/openjdk13/jdk
checking if custom source is suppressed (openjdk-only)… no
checking which debug level to use… release
checking which variants of the JVM to build… server
checking for sysroot…
checking for toolchain path…
checking for extra path…
checking where to store configuration… in default location
checking what configuration name to use… linux-x86_64-server-release
checking for zypper… no
checking for apt-get… no
checking for yum… yum
checking for pandoc… no
checking for gmake… /bin/gmake
configure: Testing potential make at /bin/gmake, found using gmake in PATH
configure: Using GNU make at /bin/gmake (version: GNU Make 3.82)
checking if make –output-sync is supported… no
checking if find supports -delete… yes
checking what type of tar was found… gnu
checking that grep (/bin/grep) -Fx handles empty lines in the pattern list correctly… yes
checking for unzip… /bin/unzip
checking for zip… /opt/oracle/product/18c/dbhomeXE/bin/zip
checking for ldd… /bin/ldd
checking for greadelf… no
checking for readelf… /bin/readelf
checking for dot… no
checking for hg… /usr/local/bin/hg
checking for git… /bin/git
checking for stat… /bin/stat
checking for time… /bin/time
checking for flock… /bin/flock
checking for dtrace… no
checking for gpatch… no
checking for patch… /bin/patch
checking bash version… 4.2.46
checking if bash supports pipefail… yes
checking if bash supports errexit (-e)… yes
checking for pkg-config… /bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for default LOG value…
checking headless only… no
checking for graphviz dot… no, cannot generate full docs
checking for pandoc… no, cannot generate full docs
checking full docs… no, missing dependencies
checking for cacerts file… default
checking for jni library path… default
checking if packaged modules are kept… yes (default)
checking for version string… 13-internal+0-adhoc.kubo.jdk
configure: Found potential Boot JDK using JAVA_HOME
checking for Boot JDK… /usr/local/jvm/openjdk-12-internal
checking Boot JDK version… openjdk version “12-internal” 2019-03-19 OpenJDK Runtime Environment (build 12-internal+0-adhoc.root.openjdk12) OpenJDK 64-Bit Server VM (build 12-internal+0-adhoc.root.openjdk12, mixed mode, sharing)
checking for java in Boot JDK… ok
checking for javac in Boot JDK… ok
checking for javadoc in Boot JDK… ok
checking for jar in Boot JDK… ok
checking for jarsigner in Boot JDK… ok
checking if Boot JDK is 32 or 64 bits… 64
checking for local Boot JDK Class Data Sharing (CDS)… yes, created
checking for Build JDK… yes, will use output dir
configure: Using default toolchain gcc (GNU Compiler Collection)
checking for gcc… /bin/gcc
checking resolved symbolic links for CC… /usr/bin/gcc
configure: Using gcc C compiler version 4.8.5 [gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)]
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether /bin/gcc accepts -g… yes
checking for /bin/gcc option to accept ISO C89… none needed
checking for g++… /bin/g++
checking resolved symbolic links for CXX… /usr/bin/g++
configure: Using gcc C++ compiler version 4.8.5 [g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)]
checking whether we are using the GNU C++ compiler… yes
checking whether /bin/g++ accepts -g… yes
checking how to run the C preprocessor… /bin/gcc -E
checking how to run the C++ preprocessor… /bin/g++ -E
checking for ld… ld
configure: Rewriting LD_JAOTC to “/bin/ld”
configure: Using gcc linker version 2.27 [GNU ld version 2.27-34.base.el7]
checking for ar… ar
configure: Rewriting AR to “/bin/ar”
checking for strip… strip
configure: Rewriting STRIP to “/bin/strip”
checking for nm… nm
configure: Rewriting NM to “/bin/nm”
checking for gobjcopy… no
checking for objcopy… objcopy
configure: Rewriting OBJCOPY to “/bin/objcopy”
checking for gobjdump… no
checking for objdump… objdump
configure: Rewriting OBJDUMP to “/bin/objdump”
checking for c++filt… c++filt
configure: Rewriting CXXFILT to “/bin/c++filt”
checking for jtreg… no
checking for jtreg test harness… no, not found
checking for jmh (Java Microbenchmark Harness)… no, disabled
checking for jib… no
checking if @file is supported by gcc… yes
checking if CC supports “-m64″… yes
checking if CXX supports “-m64″… yes
checking if both CC and CXX support “-m64″… yes
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking stdio.h usability… yes
checking stdio.h presence… yes
checking for stdio.h… yes
checking size of int *… 8
checking for target address size… 64 bits
checking whether byte ordering is bigendian… no
checking if native warnings are errors… true (default)
checking for library containing clock_gettime… none required
checking if CXX supports “-std=gnu++98 -Werror”… yes
checking if CC supports “-fno-delete-null-pointer-checks -Werror”… yes
checking if CXX supports “-fno-delete-null-pointer-checks -Werror”… yes
checking if both CC and CXX support “-fno-delete-null-pointer-checks -Werror”… yes
checking if CC supports “-fno-lifetime-dse -Werror”… no
checking if CXX supports “-fno-lifetime-dse -Werror”… no
checking if both CC and CXX support “-fno-lifetime-dse -Werror”… no
checking if CC supports “-fmacro-prefix-map=/home/kubo/openjdk/openjdk13/jdk/=”… no
checking if CXX supports “-fmacro-prefix-map=/home/kubo/openjdk/openjdk13/jdk/=”… no
checking if both CC and CXX support “-fmacro-prefix-map=/home/kubo/openjdk/openjdk13/jdk/=”… no
checking if CC supports “-ffp-contract=off”… yes
checking if CXX supports “-ffp-contract=off”… yes
checking if both CC and CXX support “-ffp-contract=off”… yes
checking if BUILD_CXX supports “-std=gnu++98 -Werror”… yes
checking if BUILD_CC supports “-fno-delete-null-pointer-checks -Werror”… yes
checking if BUILD_CXX supports “-fno-delete-null-pointer-checks -Werror”… yes
checking if both BUILD_CC and BUILD_CXX support “-fno-delete-null-pointer-checks -Werror”… yes
checking if BUILD_CC supports “-fno-lifetime-dse -Werror”… no
checking if BUILD_CXX supports “-fno-lifetime-dse -Werror”… no
checking if both BUILD_CC and BUILD_CXX support “-fno-lifetime-dse -Werror”… no
checking if BUILD_CC supports “-fmacro-prefix-map=/home/kubo/openjdk/openjdk13/jdk/=”… no
checking if BUILD_CXX supports “-fmacro-prefix-map=/home/kubo/openjdk/openjdk13/jdk/=”… no
checking if both BUILD_CC and BUILD_CXX support “-fmacro-prefix-map=/home/kubo/openjdk/openjdk13/jdk/=”… no
checking if BUILD_CC supports “-ffp-contract=off”… yes
checking if BUILD_CXX supports “-ffp-contract=off”… yes
checking if both BUILD_CC and BUILD_CXX support “-ffp-contract=off”… yes
checking what type of native debug symbols to use… external
checking for dtrace tool… not found, cannot build dtrace
checking sys/sdt.h usability… no
checking sys/sdt.h presence… no
checking for sys/sdt.h… no
checking if dtrace should be built… no, missing dependencies
checking if Hotspot gtest unit tests should be built… yes
checking if static link of stdc++ is possible… no
checking how to link with libstdc++… dynamic
checking for X… libraries , headers
checking for gethostbyname… yes
checking for connect… yes
checking for remove… yes
checking for shmat… yes
checking for IceConnectionNumber in -lICE… yes
checking for X11/extensions/shape.h… yes
checking for X11/extensions/Xrender.h… yes
checking for X11/extensions/XTest.h… yes
checking for X11/Intrinsic.h… yes
checking for X11/extensions/Xrandr.h… yes
checking if XlinearGradient is defined in Xrender.h… yes
checking cups/cups.h usability… yes
checking cups/cups.h presence… yes
checking for cups/cups.h… yes
checking cups/ppd.h usability… yes
checking cups/ppd.h presence… yes
checking for cups/ppd.h… yes
checking fontconfig/fontconfig.h usability… yes
checking fontconfig/fontconfig.h presence… yes
checking for fontconfig/fontconfig.h… yes
checking for FREETYPE… yes
checking for freetype… yes (using pkg-config)
Using freetype: system
checking for ALSA… yes
checking for which libjpeg to use… bundled
checking for which giflib to use… bundled
checking for PNG… yes
checking for which libpng to use… bundled
checking for compress in -lz… yes
checking for which zlib to use… system
checking for system zlib functionality… ok
checking for which lcms to use… bundled
checking for cos in -lm… yes
checking for dlopen in -ldl… yes
checking if shenandoah can be built… yes
checking if zgc can be built… yes
checking if jvmci module jdk.internal.vm.ci should be built… yes
checking if graal module jdk.internal.vm.compiler should be built… yes
checking if aot should be enabled… yes
checking if cds should be enabled… yes
checking if elliptic curve crypto implementation is present… yes
checking if jtreg failure handler should be built… no, missing jtreg
checking if the CDS classlist generation should be enabled… yes
checking if any translations should be excluded… no
checking if static man pages should be copied… yes
checking if a default CDS archive should be generated… yes
checking for number of cores… 4
checking for memory size… 7734 MB
checking for appropriate number of jobs to run in parallel… 4
checking flags for boot jdk java command … -Duser.language=en -Duser.country=US -XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=/home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release/configure-support/classes.jsa -Xshare:auto
checking flags for boot jdk java command for big workloads… -Xms64M -Xmx1600M -XX:ThreadStackSize=1536
checking flags for bootcycle boot jdk java command for big workloads… -Xms64M -Xmx1600M -XX:ThreadStackSize=1536
checking flags for boot jdk java command for small workloads… -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
checking whether to use sjavac… no
checking whether to use javac server… yes
checking If precompiled header is enabled… yes
checking that precompiled headers work… yes
checking is ccache enabled… no
checking if build directory is on local disk… yes
checking JVM features for JVM variant ‘server’… “aot cds cmsgc compiler1 compiler2 epsilongc g1gc graal jfr jni-check jvmci jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs zgc”
configure: creating /home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release/configure-support/config.status
config.status: creating /home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release/spec.gmk
config.status: creating /home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release/bootcycle-spec.gmk
config.status: creating /home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release/buildjdk-spec.gmk
config.status: creating /home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release/compare.sh
config.status: creating /home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release/Makefile

====================================================
A new configuration has been successfully created in
/home/kubo/openjdk/openjdk13/jdk/build/linux-x86_64-server-release
using default settings.

Configuration summary:
* Debug level: release
* HS debug level: product
* JVM variants: server
* JVM features: server: ‘aot cds cmsgc compiler1 compiler2 epsilongc g1gc graal jfr jni-check jvmci jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs zgc’
* OpenJDK target: OS: linux, CPU architecture: x86, address length: 64
* Version string: 13-internal+0-adhoc.kubo.jdk (13-internal)

Tools summary:
* Boot JDK: openjdk version “12-internal” 2019-03-19 OpenJDK Runtime Environment (build 12-internal+0-adhoc.root.openjdk12) OpenJDK 64-Bit Server VM (build 12-internal+0-adhoc.root.openjdk12, mixed mode, sharing) (at /usr/local/jvm/openjdk-12-internal)
* Toolchain: gcc (GNU Compiler Collection)
* C Compiler: Version 4.8.5 (at /bin/gcc)
* C++ Compiler: Version 4.8.5 (at /bin/g++)

Build performance summary:
* Cores to use: 4
* Memory limit: 7734 MB

[kubo@kubo-centos7 jdk]$ make
Building target ‘default (exploded-image)’ in configuration ‘linux-x86_64-server-release’
Compiling 8 files for BUILD_TOOLS_LANGTOOLS
Compiling 1 files for BUILD_JFR_TOOLS
Creating hotspot/variant-server/tools/adlc/adlc from 13 file(s)
Compiling 2 files for BUILD_JVMTI_TOOLS
Parsing 2 properties into enum-like class for jdk.compiler
Compiling 10 properties into resource bundles for jdk.javadoc
Compiling 19 properties into resource bundles for jdk.compiler
Compiling 12 properties into resource bundles for jdk.jdeps
Compiling 7 properties into resource bundles for jdk.jshell
Compiling 117 files for BUILD_java.compiler.interim
Compiling 400 files for BUILD_jdk.compiler.interim
Creating support/modules_libs/java.base/server/libjvm.so from 997 file(s)
Creating hotspot/variant-server/libjvm/gtest/libjvm.so from 122 file(s)
Creating hotspot/variant-server/libjvm/gtest/gtestLauncher from 1 file(s)
Compiling 218 files for BUILD_jdk.javadoc.interim
Compiling 162 files for BUILD_TOOLS_JDK
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
注意:入力ファイルの操作のうち、未チェックまたは安全ではないものがあります。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Compiling 2 files for COMPILE_DEPEND
Compiling 188 files for BUILD_jdk.rmic.interim
Compiling 3 files for BUILD_VM_COMPILER_MATCH_PROCESSOR
Compiling 5 files for BUILD_VM_COMPILER_NODEINFO_PROCESSOR
Compiling 3 files for BUILD_VM_COMPILER_OPTIONS_PROCESSOR
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
Compiling 14 files for BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR
Compiling 3 files for BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR
Creating buildtools/jdk.vm.compiler.match.processor.jar
Creating buildtools/jdk.vm.compiler.nodeinfo.processor.jar
Creating buildtools/jdk.vm.compiler.options.processor.jar
Creating buildtools/jdk.vm.compiler.replacements.verifier.jar
Creating buildtools/jdk.vm.compiler.serviceprovider.processor.jar
Compiling 11 properties into resource bundles for jdk.jartool
Compiling 11 properties into resource bundles for jdk.management.agent
Compiling 3 properties into resource bundles for jdk.jdi
Compiling 4 properties into resource bundles for jdk.jlink
Compiling 3 properties into resource bundles for jdk.jlink
Compiling 1 properties into resource bundles for jdk.jlink
Compiling 224 properties into resource bundles for jdk.localedata
Compiling 11 properties into resource bundles for java.base
Compiling 2 files for BUILD_BREAKITERATOR_BASE
Compiling 2 files for BUILD_BREAKITERATOR_LD
Compiling 11 properties into resource bundles for java.logging
Compiling 6 properties into resource bundles for java.base
Compiling 3014 files for java.base
Compiling 89 properties into resource bundles for java.desktop
Compiling 1830 files for java.xml
Compiling 10 files for java.instrument
Compiling 35 files for java.logging
Compiling 330 files for java.management
Compiling 30 files for java.security.sasl
Compiling 129 files for java.rmi
Compiling 140 files for java.net.http
Warning: generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are
encouraged to migrate away from using rmic to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 15 files for java.scripting
Compiling 5 files for java.transaction.xa
Compiling 22 files for java.smartcardio
Compiling 272 files for java.xml.crypto
Compiling 193 files for jdk.internal.vm.ci
Compiling 24 files for jdk.management
Compiling 9 files for jdk.unsupported
Compiling 61 files for jdk.internal.jvmstat
Compiling 120 files for jdk.charsets
Compiling 22 files for jdk.crypto.ec
Compiling 68 files for jdk.dynalink
Compiling 3 files for jdk.internal.ed
Compiling 44 files for jdk.httpserver
Compiling 97 files for jdk.internal.le
Compiling 51 files for jdk.internal.opt
Compiling 33 files for jdk.jartool
Compiling 1 files for jdk.jdwp.agent
Compiling 175 files for jdk.jfr
Compiling 11 files for jdk.jstatd
Compiling 1703 files for jdk.localedata
Compiling 9 files for jdk.net
Compiling 1 files for jdk.pack
Compiling 593 files for jdk.scripting.nashorn
注意:一部の入力ファイルは、削除用にマークされた推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:removalオプションを指定して再コンパイルしてください。
Compiling 138 files for BUILD_NASGEN
Compiling 33 files for jdk.sctp
Compiling 94 files for jdk.xml.dom
Running nasgen
Compiling 15 files for jdk.zipfs
Compiling 117 files for java.compiler
Compiling 18 files for java.datatransfer
Compiling 15 files for java.prefs
Compiling 197 files for java.naming
Compiling 77 files for java.sql
Compiling 15 files for jdk.attach
Compiling 404 files for jdk.compiler
Compiling 70 files for jdk.crypto.cryptoki
Compiling 40 files for jdk.jcmd
Compiling 251 files for jdk.jdi
Compiling 14 files for jdk.management.jfr
Compiling 16 files for jdk.naming.dns
Compiling 7 files for jdk.naming.rmi
Compiling 11 files for jdk.scripting.nashorn.shell
注意:一部の入力ファイルは、削除用にマークされた推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:removalオプションを指定して再コンパイルしてください。
Compiling 14 files for java.management.rmi
Compiling 217 files for java.security.jgss
Compiling 56 files for java.sql.rowset
Compiling 2780 files for java.desktop
Compiling 218 files for jdk.javadoc
Compiling 31 files for jdk.management.agent
Compiling 133 files for jdk.jdeps
Compiling 94 files for jdk.jshell
Warning: generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are
encouraged to migrate away from using rmic to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 188 files for jdk.rmic
Compiling 30 files for jdk.security.auth
Compiling 16 files for jdk.security.jgss
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
Warning: generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are
encouraged to migrate away from using rmic to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
Compiling 76 files for jdk.jlink
Compiling 1617 files for jdk.internal.vm.compiler
Compiling 108 files for jdk.aot
Compiling 3 files for jdk.editpad
Compiling 1008 files for jdk.hotspot.agent
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
注意:入力ファイルの操作のうち、未チェックまたは安全ではないものがあります。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Compiling 5 files for jdk.internal.vm.compiler.management
Compiling 64 files for jdk.jconsole
Compiling 5 files for jdk.jsobject
Compiling 8 files for jdk.unsupported.desktop
Compiling 1 files for java.se
Compiling 18 files for jdk.accessibility
Compiling 67 files for COMPILE_CREATE_SYMBOLS
Creating ct.sym classes
Creating support/symbols/ct.sym
Creating support/modules_libs/java.base/libverify.so from 2 file(s)
Creating support/modules_libs/java.base/libjava.so from 58 file(s)
Creating support/native/java.base/libfdlibm.a from 57 file(s)
Creating support/modules_libs/java.base/libzip.so from 5 file(s)
Creating support/modules_libs/java.base/libjimage.so from 6 file(s)
Creating support/modules_libs/java.base/libnet.so from 21 file(s)
Creating support/modules_libs/java.base/libjli.so from 8 file(s)
Creating support/modules_libs/java.base/libnio.so from 19 file(s)
Creating support/modules_libs/java.base/libjsig.so from 1 file(s)
Creating support/modules_libs/java.management/libmanagement.so from 9 file(s)
Creating support/modules_libs/java.instrument/libinstrument.so from 12 file(s)
Creating support/native/java.base/java_objs/java from 1 file(s)
Creating support/modules_cmds/java.base/keytool from 1 file(s)
Creating support/modules_libs/java.base/jexec from 1 file(s)
Creating support/modules_libs/java.base/jspawnhelper from 1 file(s)
Creating support/modules_libs/java.desktop/libmlib_image.so from 50 file(s)
Creating support/modules_libs/java.desktop/libawt.so from 73 file(s)
Creating support/modules_libs/java.desktop/libawt_xawt.so from 52 file(s)
Creating support/modules_libs/java.desktop/liblcms.so from 27 file(s)
Creating support/modules_libs/java.desktop/libjavajpeg.so from 46 file(s)
Creating support/modules_libs/java.desktop/libawt_headless.so from 26 file(s)
Creating support/modules_libs/java.desktop/libfontmanager.so from 61 file(s)
Creating support/modules_libs/java.desktop/libjawt.so from 1 file(s)
Creating support/modules_libs/java.desktop/libsplashscreen.so from 67 file(s)
Creating support/modules_libs/java.desktop/libjsound.so from 18 file(s)
Creating support/modules_libs/java.prefs/libprefs.so from 1 file(s)
Creating support/modules_libs/java.rmi/librmi.so from 1 file(s)
Creating support/modules_cmds/java.rmi/rmid from 1 file(s)
Creating support/modules_cmds/java.rmi/rmiregistry from 1 file(s)
Creating support/modules_cmds/java.scripting/jrunscript from 1 file(s)
Creating support/modules_libs/java.security.jgss/libj2gss.so from 3 file(s)
Creating support/modules_libs/java.smartcardio/libj2pcsc.so from 2 file(s)
Creating support/modules_cmds/jdk.aot/jaotc from 1 file(s)
Creating support/modules_libs/jdk.attach/libattach.so from 1 file(s)
Creating support/modules_cmds/jdk.compiler/javac from 1 file(s)
Creating support/modules_cmds/jdk.compiler/serialver from 1 file(s)
Creating support/modules_libs/jdk.crypto.cryptoki/libj2pkcs11.so from 14 file(s)
Creating support/modules_libs/jdk.crypto.ec/libsunec.so from 28 file(s)
Creating support/modules_libs/jdk.hotspot.agent/libsaproc.so from 7 file(s)
Creating support/modules_cmds/jdk.hotspot.agent/jhsdb from 1 file(s)
Creating support/modules_cmds/jdk.jartool/jar from 1 file(s)
Creating support/modules_cmds/jdk.jartool/jarsigner from 1 file(s)
Creating support/modules_cmds/jdk.javadoc/javadoc from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jinfo from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jmap from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jps from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jstack from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jstat from 1 file(s)
Creating support/modules_cmds/jdk.jcmd/jcmd from 1 file(s)
Creating support/modules_cmds/jdk.jconsole/jconsole from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/javap from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeps from 1 file(s)
Creating support/modules_cmds/jdk.jdeps/jdeprscan from 1 file(s)
Creating support/modules_cmds/jdk.jdi/jdb from 1 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libdt_socket.so from 2 file(s)
Creating support/modules_libs/jdk.jdwp.agent/libjdwp.so from 42 file(s)
Creating support/modules_cmds/jdk.jfr/jfr from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jimage from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jlink from 1 file(s)
Creating support/modules_cmds/jdk.jlink/jmod from 1 file(s)
Creating support/modules_cmds/jdk.jshell/jshell from 1 file(s)
Creating support/modules_cmds/jdk.jstatd/jstatd from 1 file(s)
Creating support/modules_libs/jdk.management/libmanagement_ext.so from 8 file(s)
Creating support/modules_libs/jdk.management.agent/libmanagement_agent.so from 1 file(s)
Creating support/modules_libs/jdk.net/libextnet.so from 1 file(s)
Creating support/modules_libs/jdk.pack/libunpack.so from 7 file(s)
Creating support/modules_cmds/jdk.pack/pack200 from 1 file(s)
Creating support/modules_cmds/jdk.pack/unpack200 from 7 file(s)
Creating support/modules_cmds/jdk.rmic/rmic from 1 file(s)
Creating support/modules_cmds/jdk.scripting.nashorn.shell/jjs from 1 file(s)
Creating support/modules_libs/jdk.sctp/libsctp.so from 2 file(s)
Creating support/modules_libs/jdk.security.auth/libjaas.so from 1 file(s)
Compiling 4 files for BUILD_JIGSAW_TOOLS
Stopping sjavac server
Finished building target ‘default (exploded-image)’ in configuration ‘linux-x86_64-server-release’
[kubo@kubo-centos7 jdk]$ sudo make install
[sudo] kubo のパスワード:
Building target ‘install’ in configuration ‘linux-x86_64-server-release’
Compiling 31 files for BUILD_JRTFS
信頼できないファイル /home/kubo/openjdk/openjdk13/jdk/.hg/hgrc (所有者 kubo, グループ kubo)
Creating support/modules_libs/java.base/jrt-fs.jar
信頼できないファイル /home/kubo/openjdk/openjdk13/jdk/.hg/hgrc (所有者 kubo, グループ kubo)
Updating images/sec-bin.zip
Creating interim java.base.jmod
Creating interim java.logging.jmod
Updating support/src.zip
Creating java.compiler.jmod
Creating java.datatransfer.jmod
Creating java.desktop.jmod
Creating java.instrument.jmod
Creating java.logging.jmod
Creating java.management.jmod
Creating java.management.rmi.jmod
Creating java.naming.jmod
Creating java.net.http.jmod
Creating java.prefs.jmod
Creating java.rmi.jmod
Creating java.scripting.jmod
Creating java.se.jmod
Creating java.security.jgss.jmod
Creating java.security.sasl.jmod
Creating java.smartcardio.jmod
Creating java.sql.jmod
Creating java.sql.rowset.jmod
Creating java.transaction.xa.jmod
Creating java.xml.jmod
Creating java.xml.crypto.jmod
Creating jdk.accessibility.jmod
Creating jdk.aot.jmod
Creating jdk.attach.jmod
Creating jdk.charsets.jmod
Creating jdk.compiler.jmod
Creating jdk.crypto.cryptoki.jmod
Creating jdk.crypto.ec.jmod
Creating jdk.dynalink.jmod
Creating jdk.editpad.jmod
Creating jdk.hotspot.agent.jmod
Creating jdk.httpserver.jmod
Creating jdk.internal.ed.jmod
Creating jdk.internal.jvmstat.jmod
Creating jdk.internal.le.jmod
Creating jdk.internal.opt.jmod
Creating jdk.internal.vm.ci.jmod
Creating jdk.internal.vm.compiler.jmod
Creating jdk.internal.vm.compiler.management.jmod
Creating jdk.jartool.jmod
Creating jdk.javadoc.jmod
Creating jdk.jcmd.jmod
Creating jdk.jconsole.jmod
Creating jdk.jdeps.jmod
Creating jdk.jdi.jmod
Creating jdk.jdwp.agent.jmod
Creating jdk.jshell.jmod
Creating jdk.jfr.jmod
Creating jdk.jsobject.jmod
Creating jdk.jstatd.jmod
Creating jdk.management.jmod
Creating jdk.localedata.jmod
Creating jdk.management.agent.jmod
Creating jdk.management.jfr.jmod
Creating jdk.naming.dns.jmod
Creating jdk.naming.rmi.jmod
Creating jdk.net.jmod
Creating jdk.pack.jmod
Creating jdk.rmic.jmod
Creating jdk.scripting.nashorn.jmod
Creating jdk.scripting.nashorn.shell.jmod
Creating jdk.sctp.jmod
Creating jdk.security.auth.jmod
Creating jdk.security.jgss.jmod
Creating jdk.unsupported.jmod
Creating jdk.unsupported.desktop.jmod
Creating jdk.xml.dom.jmod
Creating jdk.zipfs.jmod
Creating interim jimage
Compiling 3 files for BUILD_DEMO_CodePointIM
Updating support/demos/image/jfc/CodePointIM/src.zip
Compiling 1 files for CLASSLIST_JAR
Compiling 3 files for BUILD_DEMO_FileChooserDemo
Updating support/demos/image/jfc/FileChooserDemo/src.zip
Creating support/classlist.jar
注意:/home/kubo/openjdk/openjdk13/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.javaは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
注意:/home/kubo/openjdk/openjdk13/jdk/src/demo/share/jfc/FileChooserDemo/FileChooserDemo.javaの操作は、未チェックまたは安全ではありません。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Creating jdk.jlink.jmod
Compiling 30 files for BUILD_DEMO_SwingSet2
Updating support/demos/image/jfc/SwingSet2/src.zip
Compiling 4 files for BUILD_DEMO_Font2DTest
Updating support/demos/image/jfc/Font2DTest/src.zip
Creating java.base.jmod
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
注意:入力ファイルの操作のうち、未チェックまたは安全ではないものがあります。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
注意:入力ファイルの操作のうち、未チェックまたは安全ではないものがあります。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Compiling 64 files for BUILD_DEMO_J2Ddemo
Updating support/demos/image/jfc/J2Ddemo/src.zip
Compiling 15 files for BUILD_DEMO_Metalworks
Updating support/demos/image/jfc/Metalworks/src.zip
注意:/home/kubo/openjdk/openjdk13/jdk/src/demo/share/jfc/Metalworks/MetalworksPrefs.javaの操作は、未チェックまたは安全ではありません。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Compiling 2 files for BUILD_DEMO_Notepad
Updating support/demos/image/jfc/Notepad/src.zip
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
注意:入力ファイルの操作のうち、未チェックまたは安全ではないものがあります。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Compiling 5 files for BUILD_DEMO_Stylepad
Updating support/demos/image/jfc/Stylepad/src.zip
Compiling 5 files for BUILD_DEMO_SampleTree
Updating support/demos/image/jfc/SampleTree/src.zip
注意:/home/kubo/openjdk/openjdk13/jdk/src/demo/share/jfc/Stylepad/Stylepad.javaの操作は、未チェックまたは安全ではありません。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Compiling 8 files for BUILD_DEMO_TableExample
Updating support/demos/image/jfc/TableExample/src.zip
Compiling 1 files for BUILD_DEMO_TransparentRuler
Updating support/demos/image/jfc/TransparentRuler/src.zip
注意:一部の入力ファイルは推奨されないAPIを使用またはオーバーライドしています。
注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
注意:/home/kubo/openjdk/openjdk13/jdk/src/demo/share/jfc/TableExample/TableExample4.javaの操作は、未チェックまたは安全ではありません。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
Creating support/demos/image/jfc/CodePointIM/CodePointIM.jar
Creating support/demos/image/jfc/FileChooserDemo/FileChooserDemo.jar
Creating support/demos/image/jfc/SwingSet2/SwingSet2.jar
Creating support/demos/image/jfc/Font2DTest/Font2DTest.jar
Creating support/demos/image/jfc/J2Ddemo/J2Ddemo.jar
Creating support/demos/image/jfc/Metalworks/Metalworks.jar
Creating support/demos/image/jfc/Notepad/Notepad.jar
Creating support/demos/image/jfc/Stylepad/Stylepad.jar
Creating support/demos/image/jfc/SampleTree/SampleTree.jar
Creating support/demos/image/jfc/TableExample/TableExample.jar
Creating support/demos/image/jfc/TransparentRuler/TransparentRuler.jar
Creating jdk image
Creating CDS archive for jdk image
Installing jdk image into /usr/local/jvm/openjdk-13-internal
and creating 33 links from /usr/local/bin into the jdk.
Stopping sjavac server
Finished building target ‘install’ in configuration ‘linux-x86_64-server-release’
[kubo@kubo-centos7 jdk]$ javac -version
javac 13-internal
[kubo@kubo-centos7 jdk]$