diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-01-07 18:11:41 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-01-07 18:11:41 +0100 |
commit | 8421ef622dc8e51503bad3bc0fbee0aa63ff1b8b (patch) | |
tree | 9824a83704eca844d98cf35b0f1f3f543b493f8f /api | |
parent | c4ec6bc0f552fe7af693d52826c82f1e7db908de (diff) | |
download | MultiMC-8421ef622dc8e51503bad3bc0fbee0aa63ff1b8b.tar MultiMC-8421ef622dc8e51503bad3bc0fbee0aa63ff1b8b.tar.gz MultiMC-8421ef622dc8e51503bad3bc0fbee0aa63ff1b8b.tar.lz MultiMC-8421ef622dc8e51503bad3bc0fbee0aa63ff1b8b.tar.xz MultiMC-8421ef622dc8e51503bad3bc0fbee0aa63ff1b8b.zip |
NOISSUE even more java polishing
* Memory minimums lowered to 128M in all Java settings UIs
* Changing the memory sizes on the wizard page does not automatically trigger checks if the executable doesn't have 'java' in the name
* Java detection on linux now scans some common JRE locations, not just /usr/bin/java
Diffstat (limited to 'api')
-rw-r--r-- | api/logic/java/JavaUtils.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/api/logic/java/JavaUtils.cpp b/api/logic/java/JavaUtils.cpp index 79932eda..8851e889 100644 --- a/api/logic/java/JavaUtils.cpp +++ b/api/logic/java/JavaUtils.cpp @@ -154,10 +154,12 @@ QList<QString> JavaUtils::FindJavaPaths() KEY_WOW64_32KEY, "SOFTWARE\\JavaSoft\\Java Development Kit"); java_candidates.append(JRE64s); + java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre8/bin/javaw.exe")); java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre7/bin/javaw.exe")); java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre6/bin/javaw.exe")); java_candidates.append(JDK64s); java_candidates.append(JRE32s); + java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre8/bin/javaw.exe")); java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre7/bin/javaw.exe")); java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre6/bin/javaw.exe")); java_candidates.append(JDK32s); @@ -205,9 +207,36 @@ QList<QString> JavaUtils::FindJavaPaths() QList<QString> javas; javas.append(this->GetDefaultJava()->path); - javas.append("/opt/java/bin/java"); - javas.append("/usr/bin/java"); + auto scanJavaDir = [&](const QString & dirPath) + { + QDir dir(dirPath); + if(!dir.exists()) + return; + auto entries = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); + for(auto & entry: entries) + { + + QString prefix; + if(entry.isAbsolute()) + { + prefix = entry.absoluteFilePath(); + } + else + { + prefix = entry.filePath(); + } + javas.append(FS::PathCombine(prefix, "jre/bin/java")); + javas.append(FS::PathCombine(prefix, "bin/java")); + } + }; + // oracle RPMs + scanJavaDir("/usr/java"); + // general locations used by distro packaging + scanJavaDir("/usr/lib/jvm"); + scanJavaDir("/usr/lib32/jvm"); + // javas stored in MultiMC's folder + scanJavaDir("java"); return javas; } #else |