Inside Visual Studio Code, you will need to set the salesforcedx-vscode-apex.java.home to one of the following values. MacOS: For Mac OS X 10.5 or later, run /usr/libexec/javahome in your Terminal to get the default JDK location. To find all installed JDKs, use /usr/libexec/javahome -V. In Visual Studio Code, click File Preferences Settings (Windows or Linux) or Code Preferences Settings (macOS). Enter apex java in the search box. In the salesforcedx-vscode-apex.java.home setting, enter the Java installation directory you want to use.
I got stuck yesterday when I was trying to change the settings.jsonin Visual Studio Code becuase of not understanding there are different ways for different situations.
As I figured out, there are three ways to edit settings.json
- in User Preferences (Global)
- in Folder
- in Workspace
in User Preferences (Global)
Android Studio Jdk Version
You can change the settings.json from your user preferences. This changes are global. Therefore it will affect all of your projects. Here are 2 ways to reach that globalsettings.json file.
- File -> Preferences -> Settings -> Extensions -> Scroll down and find 'Edit in settings.json'
- Or in these paths in your OS
- Windows %APPDATA%CodeUsersettings.json
- macOS $HOME/Library/Application Support/Code/User/settings.json
- Linux $HOME/.config/Code/User/settings.json
Android Studio Jdk Setting
You can add the settings to this file (may be given by a extension) and make all of these settings global.
in Folder
If you have opened a folder (File -> Open Folder), here's the way to add settings.json in the folder. This will affect only the current folder
- Create a folder named .vscode in the root folder
- Create a file named settings.json in that folder and add your settings there.
in Workspace
Android Studio Jdk 11
If you have opened a workspace (File -> Open Workspace to open or saved using File -> Save Workspace As...), here are the steps to changesettings of the workspace. Note that in this way, you don't have a settings.json. But, you can do everything done by itin another way.
- When you save the workspace, it creates a file called yourworkspace.code-workspace
- Open that file in Visual Studio Code. Then you will see something like this.
- You can add the settings by adding a key named 'settings' in JSON.
When you add settings into yourwokspace.code-workspace file, the settings will only be available for the current workspace.
Thank you for reading!
Tagged:Visual Studio CodeYou can connect with me on Twitter or Linkedin.Android Studio Jdk Download
Written OnApr 22, 2019Configure Jdk In Visual Studio Code
Jdk Setting Path
Requirements
Quick StartFeaturesSet Checkstyle Configuration File
Set Checkstyle Version
Check the Style and Fix the Violations
Settings
or Release NotesRefer to CHANGELOG.md |