< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




  27 #include "classfile/javaAssertions.hpp"
  28 #include "classfile/symbolTable.hpp"
  29 #include "compiler/compilerOracle.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/cardTableRS.hpp"
  32 #include "memory/genCollectedHeap.hpp"
  33 #include "memory/referenceProcessor.hpp"
  34 #include "memory/universe.inline.hpp"
  35 #include "oops/oop.inline.hpp"
  36 #include "prims/jvmtiExport.hpp"
  37 #include "runtime/arguments.hpp"
  38 #include "runtime/arguments_ext.hpp"
  39 #include "runtime/globals_extension.hpp"
  40 #include "runtime/java.hpp"
  41 #include "services/management.hpp"
  42 #include "services/memTracker.hpp"
  43 #include "utilities/defaultStream.hpp"
  44 #include "utilities/macros.hpp"
  45 #include "utilities/stringUtils.hpp"
  46 #include "utilities/taskqueue.hpp"



  47 #ifdef TARGET_OS_FAMILY_linux
  48 # include "os_linux.inline.hpp"
  49 #endif
  50 #ifdef TARGET_OS_FAMILY_solaris
  51 # include "os_solaris.inline.hpp"
  52 #endif
  53 #ifdef TARGET_OS_FAMILY_windows
  54 # include "os_windows.inline.hpp"
  55 #endif
  56 #ifdef TARGET_OS_FAMILY_aix
  57 # include "os_aix.inline.hpp"
  58 #endif
  59 #ifdef TARGET_OS_FAMILY_bsd
  60 # include "os_bsd.inline.hpp"
  61 #endif
  62 #if INCLUDE_ALL_GCS
  63 #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
  64 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  65 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
  66 #endif // INCLUDE_ALL_GCS


 134 SystemProperty *Arguments::_java_home = NULL;
 135 SystemProperty *Arguments::_java_class_path = NULL;
 136 SystemProperty *Arguments::_sun_boot_class_path = NULL;
 137 
 138 char* Arguments::_meta_index_path = NULL;
 139 char* Arguments::_meta_index_dir = NULL;
 140 
 141 // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string
 142 
 143 static bool match_option(const JavaVMOption *option, const char* name,
 144                          const char** tail) {
 145   int len = (int)strlen(name);
 146   if (strncmp(option->optionString, name, len) == 0) {
 147     *tail = option->optionString + len;
 148     return true;
 149   } else {
 150     return false;
 151   }
 152 }
 153 














 154 static void logOption(const char* opt) {
 155   if (PrintVMOptions) {
 156     jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt);
 157   }
 158 }
 159 
 160 // Process java launcher properties.
 161 void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
 162   // See if sun.java.launcher or sun.java.launcher.pid is defined.
 163   // Must do this before setting up other system properties,
 164   // as some of them may depend on launcher type.
 165   for (int index = 0; index < args->nOptions; index++) {
 166     const JavaVMOption* option = args->options + index;
 167     const char* tail;
 168 
 169     if (match_option(option, "-Dsun.java.launcher=", &tail)) {
 170       process_java_launcher_argument(tail, option->extraInfo);
 171       continue;
 172     }
 173     if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) {


 535       *cp_tmp = separator;
 536       memcpy(++cp_tmp, str, str_len + 1);       // copy the trailing null
 537     }
 538   }
 539   return cp;
 540 }
 541 
 542 // Scan the directory and append any jar or zip files found to path.
 543 // Note:  path must be c-heap-allocated (or NULL); it is freed if non-null.
 544 char* SysClassPath::add_jars_to_path(char* path, const char* directory) {
 545   DIR* dir = os::opendir(directory);
 546   if (dir == NULL) return path;
 547 
 548   char dir_sep[2] = { '\0', '\0' };
 549   size_t directory_len = strlen(directory);
 550   const char fileSep = *os::file_separator();
 551   if (directory[directory_len - 1] != fileSep) dir_sep[0] = fileSep;
 552 
 553   /* Scan the directory for jars/zips, appending them to path. */
 554   struct dirent *entry;
 555   char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal);
 556   while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
 557     const char* name = entry->d_name;
 558     const char* ext = name + strlen(name) - 4;
 559     bool isJarOrZip = ext > name &&
 560       (os::file_name_strcmp(ext, ".jar") == 0 ||
 561        os::file_name_strcmp(ext, ".zip") == 0);
 562     if (isJarOrZip) {
 563       size_t length = directory_len + 2 + strlen(name);
 564       char* jarpath = NEW_C_HEAP_ARRAY(char, length, mtInternal);
 565       jio_snprintf(jarpath, length, "%s%s%s", directory, dir_sep, name);
 566       path = add_to_path(path, jarpath, false);
 567       FREE_C_HEAP_ARRAY(char, jarpath, mtInternal);
 568     }
 569   }
 570   FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
 571   os::closedir(dir);
 572   return path;
 573 }
 574 
 575 // Parses a memory size specification string.
 576 static bool atomull(const char *s, julong* result) {
 577   julong n = 0;
 578   int args_read = sscanf(s, JULONG_FORMAT, &n);
 579   if (args_read != 1) {
 580     return false;
 581   }
 582   while (*s != '\0' && isdigit(*s)) {
 583     s++;
 584   }
 585   // 4705540: illegal if more characters are found after the first non-digit
 586   if (strlen(s) > 1) {
 587     return false;
 588   }
 589   switch (*s) {
 590     case 'T': case 't':


3380       ArgsRange errcode = parse_memory_size(tail, &max_direct_memory_size, 0);
3381       if (errcode != arg_in_range) {
3382         jio_fprintf(defaultStream::error_stream(),
3383                     "Invalid maximum direct memory size: %s\n",
3384                     option->optionString);
3385         describe_range_error(errcode);
3386         return JNI_EINVAL;
3387       }
3388       FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
3389     } else if (match_option(option, "-XX:+UseVMInterruptibleIO", &tail)) {
3390       // NOTE! In JDK 9, the UseVMInterruptibleIO flag will completely go
3391       //       away and will cause VM initialization failures!
3392       warning("-XX:+UseVMInterruptibleIO is obsolete and will be removed in a future release.");
3393       FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true);
3394 #if !INCLUDE_MANAGEMENT
3395     } else if (match_option(option, "-XX:+ManagementServer", &tail)) {
3396         jio_fprintf(defaultStream::error_stream(),
3397           "ManagementServer is not supported in this VM.\n");
3398         return JNI_ERR;
3399 #endif // INCLUDE_MANAGEMENT




3400     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
3401       // Skip -XX:Flags= since that case has already been handled
3402       if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {
3403         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
3404           return JNI_EINVAL;
3405         }
3406       }
3407     // Unknown option
3408     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
3409       return JNI_ERR;
3410     }
3411   }
3412 
3413   // PrintSharedArchiveAndExit will turn on
3414   //   -Xshare:on
3415   //   -XX:+TraceClassPaths
3416   if (PrintSharedArchiveAndExit) {
3417     FLAG_SET_CMDLINE(bool, UseSharedSpaces, true);
3418     FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true);
3419     FLAG_SET_CMDLINE(bool, TraceClassPaths, true);


3464     char to  [2] = {separator, '\0'};
3465     while (StringUtils::replace_no_expand(copy, from, to) > 0) {
3466       // Keep replacing "::" -> ":" until we have no more "::" (non-windows)
3467       // Keep replacing ";;" -> ";" until we have no more ";;" (windows)
3468     }
3469 
3470     _java_class_path->set_value(copy);
3471     FreeHeap(copy); // a copy was made by set_value, so don't need this anymore
3472   }
3473 
3474   if (!PrintSharedArchiveAndExit) {
3475     ClassLoader::trace_class_path(tty, "[classpath: ", _java_class_path->value());
3476   }
3477 }
3478 
3479 static bool has_jar_files(const char* directory) {
3480   DIR* dir = os::opendir(directory);
3481   if (dir == NULL) return false;
3482 
3483   struct dirent *entry;
3484   char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(directory), mtInternal);
3485   bool hasJarFile = false;
3486   while (!hasJarFile && (entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
3487     const char* name = entry->d_name;
3488     const char* ext = name + strlen(name) - 4;
3489     hasJarFile = ext > name && (os::file_name_strcmp(ext, ".jar") == 0);
3490   }
3491   FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
3492   os::closedir(dir);
3493   return hasJarFile ;
3494 }
3495 
3496 // returns the number of directories in the given path containing JAR files
3497 // If the skip argument is not NULL, it will skip that directory
3498 static int check_non_empty_dirs(const char* path, const char* type, const char* skip) {
3499   const char separator = *os::path_separator();
3500   const char* const end = path + strlen(path);
3501   int nonEmptyDirs = 0;
3502   while (path < end) {
3503     const char* tmp_end = strchr(path, separator);
3504     if (tmp_end == NULL) {
3505       if ((skip == NULL || strcmp(path, skip) != 0) && has_jar_files(path)) {
3506         nonEmptyDirs++;
3507         jio_fprintf(defaultStream::output_stream(),
3508           "Non-empty %s directory: %s\n", type, path);
3509       }
3510       path = end;
3511     } else {


3553       "cldrdata.jar",
3554       "dnsns.jar",
3555       "jaccess.jar",
3556       "jfxrt.jar",
3557       "localedata.jar",
3558       "nashorn.jar",
3559       "sunec.jar",
3560       "sunjce_provider.jar",
3561       "sunmscapi.jar",
3562       "sunpkcs11.jar",
3563       "ucrypto.jar",
3564       "zipfs.jar",
3565       NULL
3566   };
3567 
3568   // check if the default lib/ext directory has any non-JDK jar files; if so, error
3569   DIR* dir = os::opendir(extDir);
3570   if (dir != NULL) {
3571     int num_ext_jars = 0;
3572     struct dirent *entry;
3573     char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(extDir), mtInternal);
3574     while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
3575       const char* name = entry->d_name;
3576       const char* ext = name + strlen(name) - 4;
3577       if (ext > name && (os::file_name_strcmp(ext, ".jar") == 0)) {
3578         bool is_jdk_jar = false;
3579         const char* jarfile = NULL;
3580         for (int i=0; (jarfile = jdk_ext_jars[i]) != NULL; i++) {
3581           if (os::file_name_strcmp(name, jarfile) == 0) {
3582             is_jdk_jar = true;
3583             break;
3584           }
3585         }
3586         if (!is_jdk_jar) {
3587           jio_fprintf(defaultStream::output_stream(),
3588             "%s installed in <JAVA_HOME>/lib/ext\n", name);
3589           num_ext_jars++;
3590         }
3591       }
3592     }
3593     FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
3594     os::closedir(dir);
3595     if (num_ext_jars > 0) {
3596       nonEmptyDirs += 1;
3597     }
3598   }
3599 
3600   // check if the default lib/endorsed directory exists; if so, error
3601   dir = os::opendir(endorsedDir);
3602   if (dir != NULL) {
3603     jio_fprintf(defaultStream::output_stream(), "<JAVA_HOME>/lib/endorsed exists\n");
3604     os::closedir(dir);
3605     nonEmptyDirs += 1;
3606   }
3607 
3608   if (nonEmptyDirs > 0) {
3609     jio_fprintf(defaultStream::output_stream(),
3610       "Endorsed standards override mechanism and extension mechanism "
3611       "will not be supported in a future release.\n"
3612       "Refer to JEP 220 for details (http://openjdk.java.net/jeps/220).\n");
3613     return false;




  27 #include "classfile/javaAssertions.hpp"
  28 #include "classfile/symbolTable.hpp"
  29 #include "compiler/compilerOracle.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/cardTableRS.hpp"
  32 #include "memory/genCollectedHeap.hpp"
  33 #include "memory/referenceProcessor.hpp"
  34 #include "memory/universe.inline.hpp"
  35 #include "oops/oop.inline.hpp"
  36 #include "prims/jvmtiExport.hpp"
  37 #include "runtime/arguments.hpp"
  38 #include "runtime/arguments_ext.hpp"
  39 #include "runtime/globals_extension.hpp"
  40 #include "runtime/java.hpp"
  41 #include "services/management.hpp"
  42 #include "services/memTracker.hpp"
  43 #include "utilities/defaultStream.hpp"
  44 #include "utilities/macros.hpp"
  45 #include "utilities/stringUtils.hpp"
  46 #include "utilities/taskqueue.hpp"
  47 #if INCLUDE_JFR
  48 #include "jfr/jfr.hpp"
  49 #endif
  50 #ifdef TARGET_OS_FAMILY_linux
  51 # include "os_linux.inline.hpp"
  52 #endif
  53 #ifdef TARGET_OS_FAMILY_solaris
  54 # include "os_solaris.inline.hpp"
  55 #endif
  56 #ifdef TARGET_OS_FAMILY_windows
  57 # include "os_windows.inline.hpp"
  58 #endif
  59 #ifdef TARGET_OS_FAMILY_aix
  60 # include "os_aix.inline.hpp"
  61 #endif
  62 #ifdef TARGET_OS_FAMILY_bsd
  63 # include "os_bsd.inline.hpp"
  64 #endif
  65 #if INCLUDE_ALL_GCS
  66 #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
  67 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  68 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
  69 #endif // INCLUDE_ALL_GCS


 137 SystemProperty *Arguments::_java_home = NULL;
 138 SystemProperty *Arguments::_java_class_path = NULL;
 139 SystemProperty *Arguments::_sun_boot_class_path = NULL;
 140 
 141 char* Arguments::_meta_index_path = NULL;
 142 char* Arguments::_meta_index_dir = NULL;
 143 
 144 // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string
 145 
 146 static bool match_option(const JavaVMOption *option, const char* name,
 147                          const char** tail) {
 148   int len = (int)strlen(name);
 149   if (strncmp(option->optionString, name, len) == 0) {
 150     *tail = option->optionString + len;
 151     return true;
 152   } else {
 153     return false;
 154   }
 155 }
 156 
 157 #if INCLUDE_JFR
 158 // return true on failure
 159 static bool match_jfr_option(const JavaVMOption** option) {
 160   assert((*option)->optionString != NULL, "invariant");
 161   char* tail = NULL;
 162   if (match_option(*option, "-XX:StartFlightRecording", (const char**)&tail)) {
 163     return Jfr::on_start_flight_recording_option(option, tail);
 164   } else if (match_option(*option, "-XX:FlightRecorderOptions", (const char**)&tail)) {
 165     return Jfr::on_flight_recorder_option(option, tail);
 166   }
 167   return false;
 168 }
 169 #endif
 170 
 171 static void logOption(const char* opt) {
 172   if (PrintVMOptions) {
 173     jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt);
 174   }
 175 }
 176 
 177 // Process java launcher properties.
 178 void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
 179   // See if sun.java.launcher or sun.java.launcher.pid is defined.
 180   // Must do this before setting up other system properties,
 181   // as some of them may depend on launcher type.
 182   for (int index = 0; index < args->nOptions; index++) {
 183     const JavaVMOption* option = args->options + index;
 184     const char* tail;
 185 
 186     if (match_option(option, "-Dsun.java.launcher=", &tail)) {
 187       process_java_launcher_argument(tail, option->extraInfo);
 188       continue;
 189     }
 190     if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) {


 552       *cp_tmp = separator;
 553       memcpy(++cp_tmp, str, str_len + 1);       // copy the trailing null
 554     }
 555   }
 556   return cp;
 557 }
 558 
 559 // Scan the directory and append any jar or zip files found to path.
 560 // Note:  path must be c-heap-allocated (or NULL); it is freed if non-null.
 561 char* SysClassPath::add_jars_to_path(char* path, const char* directory) {
 562   DIR* dir = os::opendir(directory);
 563   if (dir == NULL) return path;
 564 
 565   char dir_sep[2] = { '\0', '\0' };
 566   size_t directory_len = strlen(directory);
 567   const char fileSep = *os::file_separator();
 568   if (directory[directory_len - 1] != fileSep) dir_sep[0] = fileSep;
 569 
 570   /* Scan the directory for jars/zips, appending them to path. */
 571   struct dirent *entry;
 572   while ((entry = os::readdir(dir)) != NULL) {

 573     const char* name = entry->d_name;
 574     const char* ext = name + strlen(name) - 4;
 575     bool isJarOrZip = ext > name &&
 576       (os::file_name_strcmp(ext, ".jar") == 0 ||
 577        os::file_name_strcmp(ext, ".zip") == 0);
 578     if (isJarOrZip) {
 579       size_t length = directory_len + 2 + strlen(name);
 580       char* jarpath = NEW_C_HEAP_ARRAY(char, length, mtInternal);
 581       jio_snprintf(jarpath, length, "%s%s%s", directory, dir_sep, name);
 582       path = add_to_path(path, jarpath, false);
 583       FREE_C_HEAP_ARRAY(char, jarpath, mtInternal);
 584     }
 585   }

 586   os::closedir(dir);
 587   return path;
 588 }
 589 
 590 // Parses a memory size specification string.
 591 static bool atomull(const char *s, julong* result) {
 592   julong n = 0;
 593   int args_read = sscanf(s, JULONG_FORMAT, &n);
 594   if (args_read != 1) {
 595     return false;
 596   }
 597   while (*s != '\0' && isdigit(*s)) {
 598     s++;
 599   }
 600   // 4705540: illegal if more characters are found after the first non-digit
 601   if (strlen(s) > 1) {
 602     return false;
 603   }
 604   switch (*s) {
 605     case 'T': case 't':


3395       ArgsRange errcode = parse_memory_size(tail, &max_direct_memory_size, 0);
3396       if (errcode != arg_in_range) {
3397         jio_fprintf(defaultStream::error_stream(),
3398                     "Invalid maximum direct memory size: %s\n",
3399                     option->optionString);
3400         describe_range_error(errcode);
3401         return JNI_EINVAL;
3402       }
3403       FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size);
3404     } else if (match_option(option, "-XX:+UseVMInterruptibleIO", &tail)) {
3405       // NOTE! In JDK 9, the UseVMInterruptibleIO flag will completely go
3406       //       away and will cause VM initialization failures!
3407       warning("-XX:+UseVMInterruptibleIO is obsolete and will be removed in a future release.");
3408       FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true);
3409 #if !INCLUDE_MANAGEMENT
3410     } else if (match_option(option, "-XX:+ManagementServer", &tail)) {
3411         jio_fprintf(defaultStream::error_stream(),
3412           "ManagementServer is not supported in this VM.\n");
3413         return JNI_ERR;
3414 #endif // INCLUDE_MANAGEMENT
3415 #if INCLUDE_JFR
3416     } else if (match_jfr_option(&option)) {
3417       return JNI_EINVAL;
3418 #endif
3419     } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
3420       // Skip -XX:Flags= since that case has already been handled
3421       if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {
3422         if (!process_argument(tail, args->ignoreUnrecognized, origin)) {
3423           return JNI_EINVAL;
3424         }
3425       }
3426     // Unknown option
3427     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
3428       return JNI_ERR;
3429     }
3430   }
3431 
3432   // PrintSharedArchiveAndExit will turn on
3433   //   -Xshare:on
3434   //   -XX:+TraceClassPaths
3435   if (PrintSharedArchiveAndExit) {
3436     FLAG_SET_CMDLINE(bool, UseSharedSpaces, true);
3437     FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true);
3438     FLAG_SET_CMDLINE(bool, TraceClassPaths, true);


3483     char to  [2] = {separator, '\0'};
3484     while (StringUtils::replace_no_expand(copy, from, to) > 0) {
3485       // Keep replacing "::" -> ":" until we have no more "::" (non-windows)
3486       // Keep replacing ";;" -> ";" until we have no more ";;" (windows)
3487     }
3488 
3489     _java_class_path->set_value(copy);
3490     FreeHeap(copy); // a copy was made by set_value, so don't need this anymore
3491   }
3492 
3493   if (!PrintSharedArchiveAndExit) {
3494     ClassLoader::trace_class_path(tty, "[classpath: ", _java_class_path->value());
3495   }
3496 }
3497 
3498 static bool has_jar_files(const char* directory) {
3499   DIR* dir = os::opendir(directory);
3500   if (dir == NULL) return false;
3501 
3502   struct dirent *entry;

3503   bool hasJarFile = false;
3504   while (!hasJarFile && (entry = os::readdir(dir)) != NULL) {
3505     const char* name = entry->d_name;
3506     const char* ext = name + strlen(name) - 4;
3507     hasJarFile = ext > name && (os::file_name_strcmp(ext, ".jar") == 0);
3508   }

3509   os::closedir(dir);
3510   return hasJarFile ;
3511 }
3512 
3513 // returns the number of directories in the given path containing JAR files
3514 // If the skip argument is not NULL, it will skip that directory
3515 static int check_non_empty_dirs(const char* path, const char* type, const char* skip) {
3516   const char separator = *os::path_separator();
3517   const char* const end = path + strlen(path);
3518   int nonEmptyDirs = 0;
3519   while (path < end) {
3520     const char* tmp_end = strchr(path, separator);
3521     if (tmp_end == NULL) {
3522       if ((skip == NULL || strcmp(path, skip) != 0) && has_jar_files(path)) {
3523         nonEmptyDirs++;
3524         jio_fprintf(defaultStream::output_stream(),
3525           "Non-empty %s directory: %s\n", type, path);
3526       }
3527       path = end;
3528     } else {


3570       "cldrdata.jar",
3571       "dnsns.jar",
3572       "jaccess.jar",
3573       "jfxrt.jar",
3574       "localedata.jar",
3575       "nashorn.jar",
3576       "sunec.jar",
3577       "sunjce_provider.jar",
3578       "sunmscapi.jar",
3579       "sunpkcs11.jar",
3580       "ucrypto.jar",
3581       "zipfs.jar",
3582       NULL
3583   };
3584 
3585   // check if the default lib/ext directory has any non-JDK jar files; if so, error
3586   DIR* dir = os::opendir(extDir);
3587   if (dir != NULL) {
3588     int num_ext_jars = 0;
3589     struct dirent *entry;
3590     while ((entry = os::readdir(dir)) != NULL) {

3591       const char* name = entry->d_name;
3592       const char* ext = name + strlen(name) - 4;
3593       if (ext > name && (os::file_name_strcmp(ext, ".jar") == 0)) {
3594         bool is_jdk_jar = false;
3595         const char* jarfile = NULL;
3596         for (int i=0; (jarfile = jdk_ext_jars[i]) != NULL; i++) {
3597           if (os::file_name_strcmp(name, jarfile) == 0) {
3598             is_jdk_jar = true;
3599             break;
3600           }
3601         }
3602         if (!is_jdk_jar) {
3603           jio_fprintf(defaultStream::output_stream(),
3604             "%s installed in <JAVA_HOME>/lib/ext\n", name);
3605           num_ext_jars++;
3606         }
3607       }
3608     }

3609     os::closedir(dir);
3610     if (num_ext_jars > 0) {
3611       nonEmptyDirs += 1;
3612     }
3613   }
3614 
3615   // check if the default lib/endorsed directory exists; if so, error
3616   dir = os::opendir(endorsedDir);
3617   if (dir != NULL) {
3618     jio_fprintf(defaultStream::output_stream(), "<JAVA_HOME>/lib/endorsed exists\n");
3619     os::closedir(dir);
3620     nonEmptyDirs += 1;
3621   }
3622 
3623   if (nonEmptyDirs > 0) {
3624     jio_fprintf(defaultStream::output_stream(),
3625       "Endorsed standards override mechanism and extension mechanism "
3626       "will not be supported in a future release.\n"
3627       "Refer to JEP 220 for details (http://openjdk.java.net/jeps/220).\n");
3628     return false;


< prev index next >