--- old/src/hotspot/share/classfile/classLoader.cpp 2018-10-23 21:29:45.418924348 -0700 +++ new/src/hotspot/share/classfile/classLoader.cpp 2018-10-23 21:29:45.063890728 -0700 @@ -1472,13 +1472,13 @@ char* path = skip_uri_protocol(src); char* canonical_class_src_path = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, JVM_MAXPATHLEN); if (!get_canonical_path(path, canonical_class_src_path, JVM_MAXPATHLEN)) { - tty->print_cr("Bad pathname %s. CDS dump aborted.", path); + log_error(cds)("Bad pathname %s. CDS dump aborted.", path); vm_exit(1); } for (int i = 0; i < FileMapInfo::get_number_of_shared_paths(); i++) { SharedClassPathEntry* ent = FileMapInfo::shared_path(i); if (!get_canonical_path(ent->name(), canonical_path_table_entry, JVM_MAXPATHLEN)) { - tty->print_cr("Bad pathname %s. CDS dump aborted.", ent->name()); + log_error(cds)("Bad pathname %s. CDS dump aborted.", ent->name()); vm_exit(1); } // If the path (from the class stream source) is the same as the shared --- old/src/hotspot/share/classfile/classLoaderExt.cpp 2018-10-23 21:29:46.191997554 -0700 +++ new/src/hotspot/share/classfile/classLoaderExt.cpp 2018-10-23 21:29:45.829963271 -0700 @@ -34,6 +34,7 @@ #include "classfile/sharedPathsMiscInfo.hpp" #include "classfile/systemDictionaryShared.hpp" #include "classfile/vmSymbols.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" #include "memory/resourceArea.hpp" @@ -175,7 +176,7 @@ } if (strstr(manifest, "Extension-List:") != NULL) { - tty->print_cr("-Xshare:dump does not support Extension-List in JAR manifest: %s", entry->name()); + log_error(cds)("-Xshare:dump does not support Extension-List in JAR manifest: %s", entry->name()); vm_exit(1); } --- old/src/hotspot/share/memory/metaspace.cpp 2018-10-23 21:29:46.974071611 -0700 +++ new/src/hotspot/share/memory/metaspace.cpp 2018-10-23 21:29:46.613037423 -0700 @@ -1291,9 +1291,9 @@ if (DumpSharedSpaces) { // CDS dumping keeps loading classes, so if we hit an OOM we probably will keep hitting OOM. // We should abort to avoid generating a potentially bad archive. - tty->print_cr("Failed allocating metaspace object type %s of size " SIZE_FORMAT ". CDS dump aborted.", + log_error(cds)("Failed allocating metaspace object type %s of size " SIZE_FORMAT ". CDS dump aborted.", MetaspaceObj::type_name(type), word_size * BytesPerWord); - tty->print_cr("Please increase MaxMetaspaceSize (currently " SIZE_FORMAT " bytes).", MaxMetaspaceSize); + log_error(cds)("Please increase MaxMetaspaceSize (currently " SIZE_FORMAT " bytes).", MaxMetaspaceSize); vm_exit(1); } report_metadata_oome(loader_data, word_size, type, mdtype, THREAD); --- old/src/hotspot/share/memory/metaspaceShared.cpp 2018-10-23 21:29:47.741144249 -0700 +++ new/src/hotspot/share/memory/metaspaceShared.cpp 2018-10-23 21:29:47.390111008 -0700 @@ -1650,7 +1650,7 @@ // enable this when running real apps. SystemDictionary::remove_classes_in_error_state(); } else { - tty->print_cr("Please remove the unverifiable classes from your class list and try again"); + log_error(cds)("Please remove the unverifiable classes from your class list and try again"); exit(1); } }