1

I am getting the below error on visual studio code

The salesforcedx-vscode-apex.java.home setting defined in VS Code settings points to a missing folder. For information on how to setup the Salesforce Apex extension, see Set Your Java Version.

my setting in vs code is

"salesforcedx-vscode-apex.java.home":"C:\\Program Files\\Java\\jdk-12.0.1"

and this path is correct in my local file system.

2
  • did you try restarting VS code?
    – glls
    May 6, 2019 at 13:32
  • 100 times and even restarted my machine several times
    – gs650x
    May 6, 2019 at 13:52

1 Answer 1

5

Salesforce Extension for VS Code unfortunately doesn't seem to work with Java versions greater than 8 and that your Java version seems to be 12.

You will need to ensure that you have a Java 8 installed in your local system. I had faced the same issue and was able to resolve it only using Java 8 version. Here's the issue details related to this topic: salesforcedx-vscode-apex does not accept versions of Java greater than 8.

Additional note here: You don't need the JDK here, just having a Java 8 JRE works as well. In my current workspace, I just have Java 8 JRE version set in salesforcedx-vscode-apex.java.home and it works fine.

13
  • Thank you so much for responding, I am trying to install Java 8, will post if this will work
    – gs650x
    May 6, 2019 at 13:40
  • I have uninstalled the java 12 and installed the java 8 changed the path accordingly but the error is still the same
    – gs650x
    May 6, 2019 at 13:57
  • @gs650x Just make sure that your new installation is included in the PATH variable too and that you have restarted your VS Code to reflect that.
    – Jayant Das
    May 6, 2019 at 13:58
  • in environment variable I have %JAVA_HOME%\bin; and in JAVA_HOME = C:\Program Files\Java\jdk1.8.0_211\bin
    – gs650x
    May 6, 2019 at 14:00
  • 2
    @gs650x I could confirm that this works. You may like to review the path settings both in your env. variable and vs code. If it points to an installation of Java 8, it will work.
    – Jayant Das
    May 6, 2019 at 14:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .