1213
1214 FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
1215 os::closedir(dir);
1216
1217 return path;
1218 }
1219
1220 bool os::set_boot_path(char fileSep, char pathSep) {
1221 const char* home = Arguments::get_java_home();
1222 int home_len = (int)strlen(home);
1223
1224 static const char* meta_index_dir_format = "%/lib/";
1225 static const char* meta_index_format = "%/lib/meta-index";
1226 char* meta_index = format_boot_path(meta_index_format, home, home_len, fileSep, pathSep);
1227 if (meta_index == NULL) return false;
1228 char* meta_index_dir = format_boot_path(meta_index_dir_format, home, home_len, fileSep, pathSep);
1229 if (meta_index_dir == NULL) return false;
1230 Arguments::set_meta_index_path(meta_index, meta_index_dir);
1231
1232 char* sysclasspath = NULL;
1233
1234 // images build if rt.jar exists
1235 char* rt_jar = format_boot_path("%/lib/rt.jar", home, home_len, fileSep, pathSep);
1236 if (rt_jar == NULL) return false;
1237 struct stat st;
1238 bool has_rt_jar = (os::stat(rt_jar, &st) == 0);
1239 FREE_C_HEAP_ARRAY(char, rt_jar, mtInternal);
1240
1241 if (has_rt_jar) {
1242 // Any modification to the JAR-file list, for the boot classpath must be
1243 // aligned with install/install/make/common/Pack.gmk. Note: boot class
1244 // path class JARs, are stripped for StackMapTable to reduce download size.
1245 static const char classpath_format[] =
1246 "%/lib/resources.jar:"
1247 "%/lib/rt.jar:"
1248 "%/lib/jsse.jar:"
1249 "%/lib/jce.jar:"
1250 "%/lib/charsets.jar:"
1251 "%/lib/jfr.jar:"
1252 "%/classes";
1253 sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
1254 } else {
1255 // no rt.jar, check if developer build with exploded modules
1256 char* modules_dir = format_boot_path("%/modules", home, home_len, fileSep, pathSep);
1257 if (os::stat(modules_dir, &st) == 0) {
|
1213
1214 FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
1215 os::closedir(dir);
1216
1217 return path;
1218 }
1219
1220 bool os::set_boot_path(char fileSep, char pathSep) {
1221 const char* home = Arguments::get_java_home();
1222 int home_len = (int)strlen(home);
1223
1224 static const char* meta_index_dir_format = "%/lib/";
1225 static const char* meta_index_format = "%/lib/meta-index";
1226 char* meta_index = format_boot_path(meta_index_format, home, home_len, fileSep, pathSep);
1227 if (meta_index == NULL) return false;
1228 char* meta_index_dir = format_boot_path(meta_index_dir_format, home, home_len, fileSep, pathSep);
1229 if (meta_index_dir == NULL) return false;
1230 Arguments::set_meta_index_path(meta_index, meta_index_dir);
1231
1232 char* sysclasspath = NULL;
1233 struct stat st;
1234
1235 // modular image if bootmodules.jimage exists
1236 char* jimage = format_boot_path("%/lib/modules/bootmodules.jimage", home, home_len, fileSep, pathSep);
1237 if (jimage == NULL) return false;
1238 bool has_jimage = (os::stat(jimage, &st) == 0);
1239 if (has_jimage) {
1240 Arguments::set_sysclasspath(jimage);
1241 return true;
1242 }
1243 FREE_C_HEAP_ARRAY(char, jimage, mtInternal);
1244
1245 // images build if rt.jar exists
1246 char* rt_jar = format_boot_path("%/lib/rt.jar", home, home_len, fileSep, pathSep);
1247 if (rt_jar == NULL) return false;
1248 bool has_rt_jar = (os::stat(rt_jar, &st) == 0);
1249 FREE_C_HEAP_ARRAY(char, rt_jar, mtInternal);
1250
1251 if (has_rt_jar) {
1252 // Any modification to the JAR-file list, for the boot classpath must be
1253 // aligned with install/install/make/common/Pack.gmk. Note: boot class
1254 // path class JARs, are stripped for StackMapTable to reduce download size.
1255 static const char classpath_format[] =
1256 "%/lib/resources.jar:"
1257 "%/lib/rt.jar:"
1258 "%/lib/jsse.jar:"
1259 "%/lib/jce.jar:"
1260 "%/lib/charsets.jar:"
1261 "%/lib/jfr.jar:"
1262 "%/classes";
1263 sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep);
1264 } else {
1265 // no rt.jar, check if developer build with exploded modules
1266 char* modules_dir = format_boot_path("%/modules", home, home_len, fileSep, pathSep);
1267 if (os::stat(modules_dir, &st) == 0) {
|