3327 memcpy(dirpath, path, tmp_end - path); 3328 dirpath[tmp_end - path] = '\0'; 3329 if (has_jar_files(dirpath)) { 3330 nonEmptyDirs++; 3331 jio_fprintf(defaultStream::output_stream(), 3332 "Non-empty directory: %s\n", dirpath); 3333 } 3334 FREE_C_HEAP_ARRAY(char, dirpath); 3335 path = tmp_end + 1; 3336 } 3337 } 3338 return nonEmptyDirs; 3339 } 3340 3341 jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required) { 3342 // check if the default lib/endorsed directory exists; if so, error 3343 char path[JVM_MAXPATHLEN]; 3344 const char* fileSep = os::file_separator(); 3345 sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep); 3346 3347 #if INCLUDE_JVMCI 3348 if (EnableJVMCI) { 3349 JVMCIRuntime::save_options(_system_properties); 3350 } 3351 #endif // INCLUDE_JVMCI 3352 3353 if (CheckEndorsedAndExtDirs) { 3354 int nonEmptyDirs = 0; 3355 // check endorsed directory 3356 nonEmptyDirs += check_non_empty_dirs(path); 3357 // check the extension directories 3358 nonEmptyDirs += check_non_empty_dirs(Arguments::get_ext_dirs()); 3359 if (nonEmptyDirs > 0) { 3360 return JNI_ERR; 3361 } 3362 } 3363 3364 DIR* dir = os::opendir(path); 3365 if (dir != NULL) { 3366 jio_fprintf(defaultStream::output_stream(), 3367 "<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and standalone APIs\n" 3368 "in modular form will be supported via the concept of upgradeable modules.\n"); 3369 os::closedir(dir); 3370 return JNI_ERR; 3371 } 3372 | 3327 memcpy(dirpath, path, tmp_end - path); 3328 dirpath[tmp_end - path] = '\0'; 3329 if (has_jar_files(dirpath)) { 3330 nonEmptyDirs++; 3331 jio_fprintf(defaultStream::output_stream(), 3332 "Non-empty directory: %s\n", dirpath); 3333 } 3334 FREE_C_HEAP_ARRAY(char, dirpath); 3335 path = tmp_end + 1; 3336 } 3337 } 3338 return nonEmptyDirs; 3339 } 3340 3341 jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required) { 3342 // check if the default lib/endorsed directory exists; if so, error 3343 char path[JVM_MAXPATHLEN]; 3344 const char* fileSep = os::file_separator(); 3345 sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep); 3346 3347 if (CheckEndorsedAndExtDirs) { 3348 int nonEmptyDirs = 0; 3349 // check endorsed directory 3350 nonEmptyDirs += check_non_empty_dirs(path); 3351 // check the extension directories 3352 nonEmptyDirs += check_non_empty_dirs(Arguments::get_ext_dirs()); 3353 if (nonEmptyDirs > 0) { 3354 return JNI_ERR; 3355 } 3356 } 3357 3358 DIR* dir = os::opendir(path); 3359 if (dir != NULL) { 3360 jio_fprintf(defaultStream::output_stream(), 3361 "<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and standalone APIs\n" 3362 "in modular form will be supported via the concept of upgradeable modules.\n"); 3363 os::closedir(dir); 3364 return JNI_ERR; 3365 } 3366 |