2

I have followed the steps suggested on "Java runtime could not be located" when starting VSCode with the Salesforce Extensions.

But now I still getting the following error "

Code Editor for Visual Studio Code (Extension) Java 8 is required to run. Download and install it from https://java.com/en/download/."

The version of Java installed is:

java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
Version of Visual Studio Code: 1.27.1
Apex Code Editor for Visual Studio Code: 43.15.0

Contents of salesforcedx-vscode-apex.java.home:

{
    "salesforcedx-vscode-apex.java.home": "/Program Files/Java/jdk1.8.0_181/bin"
}

Anyone have any ideas on what's going on? I have also tried setting the environment path, but this has failed to make a difference.

2
  • This has worked for me -- salesforcedx-vscode-apex.java.home":"C:\\Program Files (x86)\\Java\\jre1.8.0_161". Can you try using this format? To me the current format you have looks to be mac oriented.
    – Jayant Das
    Sep 13, 2018 at 16:23
  • Hi, I have tried the following path: "C:\\Program Files\\Java\\jdk1.8.0_181\\bin". It's still not detecting Java 8. I noticed that you are using the 32bit version of the JRE, so I have tried to change the path to point to the JRE directory as follows, "C:\\Program Files\\Java\\jdk1.8.0_181\\jre\\bin" again no luck.
    – JoelM
    Sep 14, 2018 at 10:35

1 Answer 1

1

Fixed it!!! Used the following: { "salesforcedx-vscode-apex.java.home": "C:\Program Files\Java\jdk1.8.0_181\jre" }

1
  • With jdk1.8.0_192, this does not work. Using single backslashes causes VS Code to interpret the following characters as escaped, so don't know if a previous version didn't, but even: { "salesforcedx-vscode-apex.java.home": "C:\\Program Files\\Java\\jdk1.8.0_191\\jre" } still results in multiple "command not found" issues
    – trebleCode
    Jan 10, 2019 at 21:30

You must log in to answer this question.

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