Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salesforce CLI docker image comes with unsupported Java version for Apex extension #2571

Closed
pkozuchowski opened this issue Nov 15, 2023 · 5 comments
Labels
more information required Issue requires more information or a response from the customer

Comments

@pkozuchowski
Copy link

pkozuchowski commented Nov 15, 2023

Summary

When you open sfdx project in Dev Container using latest salesforce/cli docker image, you will see notification that Java 11 is not supported (even though it should be per docs).

Steps To Reproduce

  1. Create .devcontainers/devcontainer.json file in the root of your project with the following body:
{
    "name": "Salesforce",
    "image": "salesforce/cli:latest-full",
  
    "customizations": {
        "vscode": {
            "extensions": [
                    "salesforce.salesforcedx-vscode-expanded"
            ]         
        }
    }
}
  1. Install Docker on your machine and DevContainers extension on VS Code
  2. In command pallete select: Open in Dev Container and select your project folder
  3. Wait until everything loads

Expected result

You should be able to work on the project, since per documentation Apex extension requires Java 11 or 17

Actual result

Apex extension reports unsupported Java version
image

@pkozuchowski pkozuchowski added the investigating We're actively investigating this issue label Nov 15, 2023
Copy link

Hello @pkozuchowski 👋 It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Nov 15, 2023
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@mshanemc
Copy link
Contributor

I'll ask the vscode ext folks.

@mshanemc
Copy link
Contributor

According to them, that error is thrown when the JAVA_HOME value isn’t an absolute path. Yours seems to be, though?

Maybe what's happening

  1. you have the container, which includes java
  2. you also have your own java locally at C:/ProgramFiles (that's not in the container) and that's what VSCode is complaining about?

can you start the container, and try which java to see where it ended up, and then try the java.home setting in vscode to use that?

as you can see, I have no idea how all this works.

@pkozuchowski
Copy link
Author

I'm not sure if extension team fixed something, but I don't see the issue anymore :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more information required Issue requires more information or a response from the customer
Projects
None yet
Development

No branches or pull requests

2 participants