Skip to content

"Configure Java runtime" gives no option to install macOS arm64 JDK #2201

Closed as not planned
microsoft/vscode-java-pack
#808

Description

@TylerADavis

I just opened a java project on an arm64 Mac for the first time, and the extension isn't providing an option to install an arm64 jdk (or recognizing my current jdk).

Environment
  • Operating System: macOS 12 (arm64)
  • JDK version: 11.0.2
  • Visual Studio Code version: 1.62.0
  • Java extension version: 1.0.0
Steps To Reproduce
  1. Install Zulu build of openjdk 11 through IntelliJ
    2. JDK seems to live at ~/Library/Java/JavaVirtualMachines
  2. Install VS Code and the java extension
  3. Get message saying that Java 11 or newer must be installed
  4. Click the blue text to open the configuration page
  5. Observe no aarch64 download link. (the installed JDKs tab cannot find my jdk install, but perhaps that has something to do with how I installed Zulu, or something as described in URGENT- "Java 11 or more recent is required to run. Please download and install a recent JDK" #1543 (comment))
Current Result

VS Code offers to install x64 java.

Expected Result

VS Code offers to install aarch64 java.

Additional Information

Observe that the install options given are only for Mac x64 and not ARM64, even though adoptium.net has aarch64 builds of jdk17 for macOS. I would be glad to help contribute a fix, but I'm not sure of where the relevant code is in the codebase, and I didn't have any success with a GitHub search.

What I see when opening the configure java runtime page:
Screen Shot 2021-11-08 at 8 48 19 AM copy

adoptium.net, showing the availability of JDK17 for aarch64:
image

Activity

  1. Eskibear commented on Nov 10, 2021

    @Eskibear
    Contributor

    This webview is implemented in https://github.com/microsoft/vscode-java-pack

    BTW, the architecture is fetched via lib arch, but I'm not sure whether aarch64 is supported. See: https://github.com/microsoft/vscode-java-pack/blob/a656bd303b633bd0542b1acb090d224018e93b50/src/utils/adoptiumApi.ts#L114-L118

    Contribution is welcome.

  2. testforstephen commented on Nov 10, 2021

    @testforstephen
    Collaborator

    what node.js API returns is arm64, which is equivalent to aarch64 .

  3. Eskibear commented on Nov 10, 2021

    @Eskibear
    Contributor

    In Node.js, the os.arch() method (and process.arch property) returns a string identifying the operating system CPU architecture for which the Node.js binary was compiled.
    This is not the same as the operating system CPU architecture. For example, you can run Node.js 32-bit on a 64-bit OS. In that situation, os.arch() will return a misleading 'x86' (32-bit) value, instead of 'x64' (64-bit).

    Above is the reason to use arch lib instead of native API os.arch(). But for macOS we don't have such problem and we can always map arm64 to aarch64 to find compatible JDK.

  4. 00001011b commented on Nov 26, 2021

    @00001011b

    Now it can detect arm-macOS collectly, but still fail to recognize my existing jdk which is installed at '~/Library/Java/JavaVirtualMachines'.

    There are two jdk (see below) in my OS. Failed to check the 'x64' one.
    截屏2021-11-26 下午12 48 53

    截屏2021-11-26 下午12 49 40

    Environment

    • Operating System: macOS 12.0.1 (arm64)
    • JDK version: 17.0.1
    • Visual Studio Code version: 1.62.3
    • Java extension version: 1.0.0
  5. Eskibear commented on Nov 26, 2021

    @Eskibear
    Contributor

    but still fail to recognize my existing jdk which is installed at '~/Library/Java/JavaVirtualMachines'.

    We'll cover that in next release of java-extension-pack, using a new package to find all installed java runtimes.

    BTW, we've changed the UX of "configure java runtime" page, separating "project JDKs" from "Java tooling runtime", to avoid confusion.
    @00001011b "Installed JDKs" tab is now removed. So I want to know whether this tab helps, and how you use it.

  6. 00001011b commented on Nov 26, 2021

    @00001011b

    but still fail to recognize my existing jdk which is installed at '~/Library/Java/JavaVirtualMachines'.

    We'll cover that in next release of java-extension-pack, using a new package to find all installed java runtimes.

    BTW, we've changed the UX of "configure java runtime" page, separating "project JDKs" from "Java tooling runtime", to avoid confusion. @00001011b "Installed JDKs" tab is now removed. So I want to know whether this tab helps, and how you use it.

    I agree to remove it.(thank you for your reply)

  7. fbricon commented on Feb 12, 2026

    @fbricon
    Collaborator

    Closing as this is provided by the Java extension pack, and that issue has been fixed since then:

    Image

    If you still have an issue, open a ticket at https://github.com/microsoft/vscode-java-pack/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions