VS Code, is there a trail regarding installation of JRE8?

Thank you for the feedback and sorry our content was not clearer about how to set up Java for Salesforce Extensions for Visual Studio Code.

We have some better instructions coming in new content in the March release, but I'll make sure we get the instructions centralized and referenced from other content using VS Code, like the Lightning Web Components quick start.

Until then, here's a snippet of new content coming in March release to set up Java setting in VS Code:


Install Java Standard Edition Development Kit 8

Some features, particularly Apex support, in Salesforce Extensions for Visual Studio Code depend on the Java Platform, Standard Edition Development Kit 8 (JDK8). Even if you have another version of Java installed, you need to also install JDK8.

  1. Install Java from Java SE Development Kit 8 Downloads.

  2. Confirm Java is properly installed by locating its installation directory. We need it in the next step. For example, if you installed JDK8 build 201 then these are the default installation directories.

    • Windows: C:\Program Files\Java\jdk1.8.0_201.
    • MacOS: /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home.

Configure Java Home Setting for Apex Support

By default, Salesforce Extensions for Visual Studio Code attempts to locate your Java installation directory by looking for a JAVA_HOME or JDK_HOME environment variable on your computer. You can also set the salesforcedx-vscode-apex.java.home setting to point to the Java installation directory you want to use, which is helpful when you have multiple versions installed. For this project, let’s configure Visual Studio Code settings to point to our JDK8 installation directory.

  1. In Visual Studio Code, click File > Preferences > Settings (Windows or Linux) or Code > Preferences > Settings (macOS).

  2. Enter apex java in the search box, then under the Salesforcedx-vscode-apex > Java: Home section, click Edit in settings.json. enter image description here

  3. Change the salesforcedx-vscode-apex.java.home setting to the full path to your Java installation directory identified in the previous step. Note that for Visual Studio Code settings, the backslashes must be escaped (\) but forward slashes (/) don’t. enter image description here

  4. Relaunch Visual Studio Code to ensure the setting takes effect.

Tags:

Trailhead