logic: add java 9 path detector for windows (#843)

This commit is contained in:
Malte Langkabel
2019-12-10 13:30:30 +01:00
committed by GitHub
parent e8480d4a43
commit 097833beee
3 changed files with 14 additions and 2 deletions
@@ -5,6 +5,7 @@
#include "FilePath.h"
#include "utilityApp.h"
#include "utilityString.h"
JavaPathDetectorWindows::JavaPathDetectorWindows(const std::string javaVersion)
: JavaPathDetector("Java " + javaVersion + " for Windows", javaVersion)
@@ -20,7 +21,16 @@ std::vector<FilePath> JavaPathDetectorWindows::getPaths() const
key += "Wow6432Node\\";
}
key += ("JavaSoft\\Java Runtime Environment\\" + m_javaVersion).c_str();
key += "JavaSoft\\";
if (utility::isPrefix(std::string("1."), m_javaVersion))
{
key += ("Java Runtime Environment\\" + m_javaVersion).c_str();
}
else
{
key += ("JRE\\" + m_javaVersion).c_str();
}
QSettings expressKey(
key, QSettings::NativeFormat); // NativeFormat means from Registry on Windows.
@@ -8,7 +8,7 @@
JreSystemLibraryPathDetector::JreSystemLibraryPathDetector(
std::shared_ptr<JavaPathDetector> javaPathDetector)
: PathDetector("JRE System Library"), m_javaPathDetector(javaPathDetector)
: PathDetector(javaPathDetector->getName() + " System Library"), m_javaPathDetector(javaPathDetector)
{
}
@@ -32,6 +32,7 @@ std::shared_ptr<CombinedPathDetector> utility::getJavaRuntimePathDetector()
{
case OS_WINDOWS:
combinedDetector->addDetector(std::make_shared<JavaPathDetectorWindows>("1.8"));
combinedDetector->addDetector(std::make_shared<JavaPathDetectorWindows>("9"));
break;
case OS_MAC:
combinedDetector->addDetector(std::make_shared<JavaPathDetectorMac>("1.8"));
@@ -57,6 +58,7 @@ std::shared_ptr<CombinedPathDetector> utility::getJreSystemLibraryPathsDetector(
{
case OS_WINDOWS:
combinedDetector->addDetector(std::make_shared<JreSystemLibraryPathDetectorWindows>("1.8"));
combinedDetector->addDetector(std::make_shared<JreSystemLibraryPathDetectorWindows>("9"));
break;
case OS_MAC:
combinedDetector->addDetector(std::make_shared<JreSystemLibraryPathDetectorMac>("1.8"));