FindJava: ensure all versions can be found

Fixes: #19765
This commit is contained in:
Marc Chevrier 2019-10-01 12:44:26 +02:00
parent 14ac253af7
commit 3d02593986
2 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@ endif()
if (WIN32)
set (_JNI_HINTS)
execute_process(COMMAND REG QUERY HKLM\\SOFTWARE\\JavaSoft\\JDK /f "." /k
execute_process(COMMAND REG QUERY HKLM\\SOFTWARE\\JavaSoft\\JDK
RESULT_VARIABLE _JNI_RESULT
OUTPUT_VARIABLE _JNI_VERSIONS
ERROR_QUIET)

View File

@ -85,7 +85,7 @@ if(_JAVA_HOME)
endif()
if (WIN32)
macro (_JAVA_GET_INSTALLED_VERSIONS _KIND)
execute_process(COMMAND REG QUERY HKLM\\SOFTWARE\\JavaSoft\\${_KIND} /f "." /k
execute_process(COMMAND REG QUERY HKLM\\SOFTWARE\\JavaSoft\\${_KIND}
RESULT_VARIABLE _JAVA_RESULT
OUTPUT_VARIABLE _JAVA_VERSIONS
ERROR_QUIET)
@ -153,7 +153,7 @@ find_program(Java_JAVA_EXECUTABLE
)
if(Java_JAVA_EXECUTABLE)
execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -version
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -version
RESULT_VARIABLE res
OUTPUT_VARIABLE var
ERROR_VARIABLE var # sun-java output to stderr