jdk/src/java.base/unix/native/libjli/java_md_solinux.c
changeset 40945 f241705723ea
parent 31690 3944eaf3322c
child 42687 7a5929518e6a
child 42753 40f61533b93d
--- a/jdk/src/java.base/unix/native/libjli/java_md_solinux.c	Wed Sep 14 14:04:14 2016 +0100
+++ b/jdk/src/java.base/unix/native/libjli/java_md_solinux.c	Wed Sep 14 06:46:19 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -666,6 +666,7 @@
 GetJREPath(char *path, jint pathsize, const char * arch, jboolean speculative)
 {
     char libjava[MAXPATHLEN];
+    struct stat s;
 
     if (GetApplicationHome(path, pathsize)) {
         /* Is JRE co-located with the application? */
@@ -688,6 +689,14 @@
         }
     }
 
+    if (GetApplicationHomeFromDll(path, pathsize)) {
+        JLI_Snprintf(libjava, sizeof(libjava), "%s/lib/%s/" JAVA_DLL, path, arch);
+        if (stat(libjava, &s) == 0) {
+            JLI_TraceLauncher("JRE path is %s\n", path);
+            return JNI_TRUE;
+        }
+    }
+
     if (!speculative)
       JLI_ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
     return JNI_FALSE;