< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




3464       dirpath[tmp_end - path] = '\0';
3465       if (has_jar_files(dirpath)) {
3466         nonEmptyDirs++;
3467         jio_fprintf(defaultStream::output_stream(),
3468           "Non-empty directory: %s\n", dirpath);
3469       }
3470       FREE_C_HEAP_ARRAY(char, dirpath);
3471       path = tmp_end + 1;
3472     }
3473   }
3474   return nonEmptyDirs;
3475 }
3476 
3477 jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required) {
3478   // check if the default lib/endorsed directory exists; if so, error
3479   char path[JVM_MAXPATHLEN];
3480   const char* fileSep = os::file_separator();
3481   sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep);
3482 
3483 #if INCLUDE_JVMCI
3484   jint res = JVMCIRuntime::save_options(_system_properties);
3485   if (res != JNI_OK) {
3486     return res;
3487   }
3488 
3489   if (EnableJVMCI) {
3490     // Append lib/jvmci/*.jar to boot class path
3491     char jvmciDir[JVM_MAXPATHLEN];
3492     const char* fileSep = os::file_separator();
3493     jio_snprintf(jvmciDir, sizeof(jvmciDir), "%s%slib%sjvmci", Arguments::get_java_home(), fileSep, fileSep);
3494     DIR* dir = os::opendir(jvmciDir);
3495     if (dir != NULL) {
3496       struct dirent *entry;
3497       char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(jvmciDir), mtInternal);
3498       while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
3499         const char* name = entry->d_name;
3500         const char* ext = name + strlen(name) - 4;
3501         if (ext > name && strcmp(ext, ".jar") == 0) {
3502           char fileName[JVM_MAXPATHLEN];
3503           jio_snprintf(fileName, sizeof(fileName), "%s%s%s", jvmciDir, fileSep, name);
3504           scp_p->add_suffix(fileName);
3505           scp_assembly_required = true;
3506         }
3507       }
3508       FREE_C_HEAP_ARRAY(char, dbuf);
3509       os::closedir(dir);
3510     }
3511   }
3512 #endif // INCLUDE_JVMCI
3513 
3514   if (CheckEndorsedAndExtDirs) {
3515     int nonEmptyDirs = 0;
3516     // check endorsed directory
3517     nonEmptyDirs += check_non_empty_dirs(path);
3518     // check the extension directories
3519     nonEmptyDirs += check_non_empty_dirs(Arguments::get_ext_dirs());
3520     if (nonEmptyDirs > 0) {
3521       return JNI_ERR;
3522     }
3523   }
3524 
3525   DIR* dir = os::opendir(path);
3526   if (dir != NULL) {
3527     jio_fprintf(defaultStream::output_stream(),
3528       "<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and standalone APIs\n"
3529       "in modular form will be supported via the concept of upgradeable modules.\n");
3530     os::closedir(dir);




3464       dirpath[tmp_end - path] = '\0';
3465       if (has_jar_files(dirpath)) {
3466         nonEmptyDirs++;
3467         jio_fprintf(defaultStream::output_stream(),
3468           "Non-empty directory: %s\n", dirpath);
3469       }
3470       FREE_C_HEAP_ARRAY(char, dirpath);
3471       path = tmp_end + 1;
3472     }
3473   }
3474   return nonEmptyDirs;
3475 }
3476 
3477 jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required) {
3478   // check if the default lib/endorsed directory exists; if so, error
3479   char path[JVM_MAXPATHLEN];
3480   const char* fileSep = os::file_separator();
3481   sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep);
3482 
3483 #if INCLUDE_JVMCI





3484   if (EnableJVMCI) {
3485     JVMCIRuntime::save_options(_system_properties);




















3486   }
3487 #endif // INCLUDE_JVMCI
3488 
3489   if (CheckEndorsedAndExtDirs) {
3490     int nonEmptyDirs = 0;
3491     // check endorsed directory
3492     nonEmptyDirs += check_non_empty_dirs(path);
3493     // check the extension directories
3494     nonEmptyDirs += check_non_empty_dirs(Arguments::get_ext_dirs());
3495     if (nonEmptyDirs > 0) {
3496       return JNI_ERR;
3497     }
3498   }
3499 
3500   DIR* dir = os::opendir(path);
3501   if (dir != NULL) {
3502     jio_fprintf(defaultStream::output_stream(),
3503       "<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and standalone APIs\n"
3504       "in modular form will be supported via the concept of upgradeable modules.\n");
3505     os::closedir(dir);


< prev index next >