Merge pull request #234 from AliceDTRH/fix/dedupejava

This commit is contained in:
flow 2022-10-22 13:14:26 -03:00 committed by GitHub
commit 8b28ed67ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,7 +379,9 @@ QList<QString> JavaUtils::FindJavaPaths()
} }
} }
return addJavasFromEnv(candidates); candidates = addJavasFromEnv(candidates);
candidates.removeDuplicates();
return candidates;
} }
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
@ -402,7 +404,9 @@ QList<QString> JavaUtils::FindJavaPaths()
javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Home/bin/java"); javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Home/bin/java");
javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Commands/java"); javas.append(systemLibraryJVMDir.absolutePath() + "/" + java + "/Contents/Commands/java");
} }
return addJavasFromEnv(javas); javas = addJavasFromEnv(javas);
javas.removeDuplicates();
return javas;
} }
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
@ -448,7 +452,9 @@ QList<QString> JavaUtils::FindJavaPaths()
scanJavaDir("/opt/jdks"); scanJavaDir("/opt/jdks");
// flatpak // flatpak
scanJavaDir("/app/jdk"); scanJavaDir("/app/jdk");
return addJavasFromEnv(javas); javas = addJavasFromEnv(javas);
javas.removeDuplicates();
return javas;
} }
#else #else
QList<QString> JavaUtils::FindJavaPaths() QList<QString> JavaUtils::FindJavaPaths()