Skip to content

Commit

Permalink
Use correct filter for IntelliJ SDK architecture selector (#5073)
Browse files Browse the repository at this point in the history
IntelliJ SDK uses amd64 unlike x86_64 os.arch JVM property on macOS.
This fixes #5058 which makes impossible running intellij with bazel
plugin on intel mac.
  • Loading branch information
ujohnny authored Jul 11, 2023
1 parent 023a786 commit f0ea421
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.intellij.openapi.util.BuildNumber;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.util.PathsList;
import com.intellij.util.system.CpuArch;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -114,7 +115,6 @@ static Launch readLaunchInfo(Sdk ideaJdk) {
}
Path info = location.resolve("product-info.json");
String os = resolveOsName();
String arch = System.getProperty("os.arch");

if (Files.exists(info)) {
try {
Expand All @@ -130,7 +130,7 @@ static Launch readLaunchInfo(Sdk ideaJdk) {
}

return productInfo.launch.stream()
.filter(l -> Objects.equals(l.os, os) && Objects.equals(l.arch, arch))
.filter(l -> Objects.equals(l.os, os) && Objects.equals(CpuArch.fromString(l.arch), CpuArch.CURRENT))
.findFirst()
.orElse(null);
} catch (IOException e) {
Expand Down

0 comments on commit f0ea421

Please sign in to comment.