Deduplicates java installs before passing it on

Signed-off-by: AliceDTRH <57547425+AliceDTRH@users.noreply.github.com>
This commit is contained in:
AliceDTRH 2022-10-22 16:40:31 +02:00
parent a9d4370ad4
commit 1471eddc7e
No known key found for this signature in database
GPG Key ID: 3FFE3D96450A9ABA

View File

@ -379,7 +379,9 @@ QList<QString> JavaUtils::FindJavaPaths()
} }
} }
return addJavasFromEnv(candidates); javas = addJavasFromEnv(javas);
javas.removeDuplicates();
return javas;
} }
#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()