win32: Java 9 uses different registry keys
authorhpi1 <hpi1@anonymous.org>
Fri, 22 Dec 2017 08:11:04 +0000 (10:11 +0200)
committerhpi1 <hpi1@anonymous.org>
Fri, 22 Dec 2017 08:11:04 +0000 (10:11 +0200)
src/libbluray/bdj/bdj.c

index 27dcb9b..638f287 100644 (file)
@@ -123,6 +123,11 @@ static void *_load_jvm_win32(const char **p_java_home)
 
     r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buf_loc, 0, KEY_READ, &hkey);
     if (r != ERROR_SUCCESS) {
+        /* Try Java 9 */
+        wcscpy(buf_loc, L"SOFTWARE\\JavaSoft\\JRE\\");
+        r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buf_loc, 0, KEY_READ, &hkey);
+    }
+    if (r != ERROR_SUCCESS) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Error opening registry key SOFTWARE\\JavaSoft\\Java Runtime Environment\\\n");
         return NULL;
     }