2369 rp = realpath(dli_fname, buf); |
2369 rp = realpath(dli_fname, buf); |
2370 } |
2370 } |
2371 if (rp == NULL) |
2371 if (rp == NULL) |
2372 return; |
2372 return; |
2373 |
2373 |
2374 if (Arguments::created_by_gamma_launcher()) { |
2374 if (Arguments::sun_java_launcher_is_altjvm()) { |
2375 // Support for the gamma launcher. Typical value for buf is |
2375 // Support for the java launcher's '-XXaltjvm=<path>' option. Typical |
2376 // "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at |
2376 // value for buf is "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". |
2377 // the right place in the string, then assume we are installed in a JDK and |
2377 // If "/jre/lib/" appears at the right place in the string, then |
2378 // we're done. Otherwise, check for a JAVA_HOME environment variable and fix |
2378 // assume we are installed in a JDK and we're done. Otherwise, check |
2379 // up the path so it looks like libjvm.so is installed there (append a |
2379 // for a JAVA_HOME environment variable and fix up the path so it |
2380 // fake suffix hotspot/libjvm.so). |
2380 // looks like libjvm.so is installed there (append a fake suffix |
|
2381 // hotspot/libjvm.so). |
2381 const char *p = buf + strlen(buf) - 1; |
2382 const char *p = buf + strlen(buf) - 1; |
2382 for (int count = 0; p > buf && count < 5; ++count) { |
2383 for (int count = 0; p > buf && count < 5; ++count) { |
2383 for (--p; p > buf && *p != '/'; --p) |
2384 for (--p; p > buf && *p != '/'; --p) |
2384 /* empty */ ; |
2385 /* empty */ ; |
2385 } |
2386 } |