Filter out JRE installations on MacOS
java_home tool shows also JRE installations located at "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" path. They should not be used as there are no javac and other tools there.
This commit is contained in:
@@ -117,8 +117,13 @@ fun MutableCollection<JdkId>.discoverJdksOnMacOS(project: Project) {
|
|||||||
for (rex in macOsJavaHomeOutRegexes) {
|
for (rex in macOsJavaHomeOutRegexes) {
|
||||||
val matchResult = rex.matchEntire(line)
|
val matchResult = rex.matchEntire(line)
|
||||||
if (matchResult != null) {
|
if (matchResult != null) {
|
||||||
addIfBetter(project, matchResult.groupValues[1], matchResult.groupValues[0], File(matchResult.groupValues[3]))
|
val jdkHomeDir = File(matchResult.groupValues[3])
|
||||||
break
|
// Filter out JRE installed at /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/
|
||||||
|
// and shown by the java_home tool
|
||||||
|
if (!jdkHomeDir.path.contains("JavaAppletPlugin.plugin")) {
|
||||||
|
addIfBetter(project, matchResult.groupValues[1], matchResult.groupValues[0], jdkHomeDir)
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user