diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-02-14 20:58:09 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-02-14 20:58:09 +0100 |
commit | a59dbdcb38a8e64028d2bba82b76499d77c55cc2 (patch) | |
tree | 3d8d3da6b0e80cf6504118d2128da48150f0ad27 | |
parent | 5a0e7877b05d656741042d6a47afd6cf1d0fc6ae (diff) | |
parent | 2831ca94f8421c6b45356f4ed44abf42ffeb77b0 (diff) | |
download | MultiMC-a59dbdcb38a8e64028d2bba82b76499d77c55cc2.tar MultiMC-a59dbdcb38a8e64028d2bba82b76499d77c55cc2.tar.gz MultiMC-a59dbdcb38a8e64028d2bba82b76499d77c55cc2.tar.lz MultiMC-a59dbdcb38a8e64028d2bba82b76499d77c55cc2.tar.xz MultiMC-a59dbdcb38a8e64028d2bba82b76499d77c55cc2.zip |
Merge https://github.com/max96at/MultiMC5 into develop
-rw-r--r-- | logic/JavaUtils.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/logic/JavaUtils.cpp b/logic/JavaUtils.cpp index cf47df6f..ed90ae10 100644 --- a/logic/JavaUtils.cpp +++ b/logic/JavaUtils.cpp @@ -17,6 +17,7 @@ #include <QString> #include <QDir> #include <QMessageBox> +#include <QStringList> #include <setting.h> #include <pathutils.h> @@ -179,9 +180,21 @@ QList<QString> JavaUtils::FindJavaPaths() { QList<QString> javas; javas.append(this->GetDefaultJava()->path); + javas.append("/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/java/bin/java"); javas.append("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"); javas.append("/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java"); - + QDir libraryJVMDir("/Library/Java/JavaVirtualMachines/"); + QStringList libraryJVMJavas = libraryJVMDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + foreach (const QString &java, libraryJVMJavas) { + javas.append(libraryJVMDir.absolutePath() + "/" + java + "/Contents/Home/bin/java"); + javas.append(libraryJVMDir.absolutePath() + "/" + java + "/Contents/Home/jre/bin/java"); + } + QDir systemLibraryJVMDir("/System/Library/Java/JavaVirtualMachines/"); + QStringList systemLibraryJVMJavas = systemLibraryJVMDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + foreach (const QString &java, systemLibraryJVMJavas) { + javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Home/bin/java"); + javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Commands/java"); + } return javas; } |