src/share/vm/runtime/os.cpp

Print this page




1062     int home_len = (int)strlen(home);
1063 
1064     static const char* meta_index_dir_format = "%/lib/";
1065     static const char* meta_index_format = "%/lib/meta-index";
1066     char* meta_index = format_boot_path(meta_index_format, home, home_len, fileSep, pathSep);
1067     if (meta_index == NULL) return false;
1068     char* meta_index_dir = format_boot_path(meta_index_dir_format, home, home_len, fileSep, pathSep);
1069     if (meta_index_dir == NULL) return false;
1070     Arguments::set_meta_index_path(meta_index, meta_index_dir);
1071 
1072     // Any modification to the JAR-file list, for the boot classpath must be
1073     // aligned with install/install/make/common/Pack.gmk. Note: boot class
1074     // path class JARs, are stripped for StackMapTable to reduce download size.
1075     static const char classpath_format[] =
1076         "%/lib/resources.jar:"
1077         "%/lib/rt.jar:"
1078         "%/lib/sunrsasign.jar:"
1079         "%/lib/jsse.jar:"
1080         "%/lib/jce.jar:"
1081         "%/lib/charsets.jar:"
1082 
1083         // ## TEMPORARY hack to keep the legacy launcher working when
1084         // ## only the boot module is installed (cf. j.l.ClassLoader)
1085         "%/lib/modules/jdk.boot.jar:"
1086 
1087         "%/classes";
1088     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
1089     if (sysclasspath == NULL) return false;
1090     Arguments::set_sysclasspath(sysclasspath);
1091 
1092     return true;
1093 }
1094 
1095 /*
1096  * Splits a path, based on its separator, the number of
1097  * elements is returned back in n.
1098  * It is the callers responsibility to:
1099  *   a> check the value of n, and n may be 0.
1100  *   b> ignore any empty path elements
1101  *   c> free up the data.
1102  */
1103 char** os::split_path(const char* path, int* n) {
1104   *n = 0;
1105   if (path == NULL || strlen(path) == 0) {
1106     return NULL;




1062     int home_len = (int)strlen(home);
1063 
1064     static const char* meta_index_dir_format = "%/lib/";
1065     static const char* meta_index_format = "%/lib/meta-index";
1066     char* meta_index = format_boot_path(meta_index_format, home, home_len, fileSep, pathSep);
1067     if (meta_index == NULL) return false;
1068     char* meta_index_dir = format_boot_path(meta_index_dir_format, home, home_len, fileSep, pathSep);
1069     if (meta_index_dir == NULL) return false;
1070     Arguments::set_meta_index_path(meta_index, meta_index_dir);
1071 
1072     // Any modification to the JAR-file list, for the boot classpath must be
1073     // aligned with install/install/make/common/Pack.gmk. Note: boot class
1074     // path class JARs, are stripped for StackMapTable to reduce download size.
1075     static const char classpath_format[] =
1076         "%/lib/resources.jar:"
1077         "%/lib/rt.jar:"
1078         "%/lib/sunrsasign.jar:"
1079         "%/lib/jsse.jar:"
1080         "%/lib/jce.jar:"
1081         "%/lib/charsets.jar:"





1082         "%/classes";
1083     char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
1084     if (sysclasspath == NULL) return false;
1085     Arguments::set_sysclasspath(sysclasspath);
1086 
1087     return true;
1088 }
1089 
1090 /*
1091  * Splits a path, based on its separator, the number of
1092  * elements is returned back in n.
1093  * It is the callers responsibility to:
1094  *   a> check the value of n, and n may be 0.
1095  *   b> ignore any empty path elements
1096  *   c> free up the data.
1097  */
1098 char** os::split_path(const char* path, int* n) {
1099   *n = 0;
1100   if (path == NULL || strlen(path) == 0) {
1101     return NULL;