< prev index next >

src/hotspot/share/classfile/classLoader.cpp

Print this page




 619     LogStream ls(lt);
 620     if (msg) {
 621       ls.print("%s", msg);
 622     }
 623     if (name) {
 624       if (strlen(name) < 256) {
 625         ls.print("%s", name);
 626       } else {
 627         // For very long paths, we need to print each character separately,
 628         // as print_cr() has a length limit
 629         while (name[0] != '\0') {
 630           ls.print("%c", name[0]);
 631           name++;
 632         }
 633       }
 634     }
 635     ls.cr();
 636   }
 637 }
 638 
 639 #if INCLUDE_CDS
 640 void ClassLoader::check_shared_classpath(const char *path) {
 641   if (strcmp(path, "") == 0) {
 642     exit_with_path_failure("Cannot have empty path in archived classpaths", NULL);
 643   }
 644 
 645   struct stat st;
 646   if (os::stat(path, &st) == 0) {
 647     if ((st.st_mode & S_IFMT) != S_IFREG) { // is not a regular file
 648       if (!os::dir_is_empty(path)) {
 649         tty->print_cr("Error: non-empty directory '%s'", path);
 650         exit_with_path_failure("CDS allows only empty directories in archived classpaths",
 651 NULL);
 652       }
 653     }
 654   }
 655 }
 656 #endif
 657 
 658 void ClassLoader::setup_bootstrap_search_path() {
 659   const char* sys_class_path = Arguments::get_sysclasspath();
 660   if (PrintSharedArchiveAndExit) {
 661     // Don't print sys_class_path - this is the bootcp of this current VM process, not necessarily
 662     // the same as the bootcp of the shared archive.
 663   } else {
 664     trace_class_path("bootstrap loader class path=", sys_class_path);
 665   }
 666 #if INCLUDE_CDS
 667   if (DumpSharedSpaces) {
 668     _shared_paths_misc_info->add_boot_classpath(sys_class_path);
 669   }
 670 #endif
 671   setup_boot_search_path(sys_class_path);
 672 }
 673 
 674 #if INCLUDE_CDS
 675 int ClassLoader::get_shared_paths_misc_info_size() {
 676   return _shared_paths_misc_info->get_used_bytes();
 677 }




 619     LogStream ls(lt);
 620     if (msg) {
 621       ls.print("%s", msg);
 622     }
 623     if (name) {
 624       if (strlen(name) < 256) {
 625         ls.print("%s", name);
 626       } else {
 627         // For very long paths, we need to print each character separately,
 628         // as print_cr() has a length limit
 629         while (name[0] != '\0') {
 630           ls.print("%c", name[0]);
 631           name++;
 632         }
 633       }
 634     }
 635     ls.cr();
 636   }
 637 }
 638 



















 639 void ClassLoader::setup_bootstrap_search_path() {
 640   const char* sys_class_path = Arguments::get_sysclasspath();
 641   if (PrintSharedArchiveAndExit) {
 642     // Don't print sys_class_path - this is the bootcp of this current VM process, not necessarily
 643     // the same as the bootcp of the shared archive.
 644   } else {
 645     trace_class_path("bootstrap loader class path=", sys_class_path);
 646   }
 647 #if INCLUDE_CDS
 648   if (DumpSharedSpaces) {
 649     _shared_paths_misc_info->add_boot_classpath(sys_class_path);
 650   }
 651 #endif
 652   setup_boot_search_path(sys_class_path);
 653 }
 654 
 655 #if INCLUDE_CDS
 656 int ClassLoader::get_shared_paths_misc_info_size() {
 657   return _shared_paths_misc_info->get_used_bytes();
 658 }


< prev index next >