Recently, I installed the Salesforce CLI and set up VS Code with the Salesforce extensions. After creating a new project, when I try to open an Apex file, I receive the error message “unable to activate the Apex language server.” Then, after going through the VS Code settings, I found out that the JDK path was not set correctly.
Here, I will explain to you how to solve the error that you faced when unable to activate the apex language server in the VS code editor.
While developing Apex code, you sometimes face this type of error, especially when you connect VS Code to the Salesforce org for the first time. This error occurs because we didn’t set the VS Code folder path to Java.

Solve Error: Unable to Activate the Apex Language Server
In the following steps, I have explained how you can completely solve the apex language server error.
- To resolve the error, we need to download and install JDK 11 or 17 according to the OS installed on your system.

- After downloading the JDK, you need to install it. When the installation is done successfully, you will see the Finish button.

- Then, you need to copy the JDK folder path where you installed it. After navigating to the installed location, copy the file path.

- Then open the VS Code editor. Click the File menu, then click the Preferences option. Under the preferences, you will see the Settings option; click on it.

- As you open the preference settings, you need to search for Apex in the search bar, and as you scroll down, you will see the Salesforce-vscode-apex option. Under that option, you will see some examples of different OS.
- Below those examples, you will see a text box where you need to paste the copied JDK folder path. Upon entering the path, you can view examples of the path format and must enter the path accordingly.
- After entering the path, wait for 2 minutes and then restart the VS Code application; you will see that the ‘unable to activate the Apex language server‘ error is resolved.

In this way, you can resolve the Apex language server error.
Conclusion
I hope you now have an idea of being unable to activate the Apex language server error. I have explained when this type of error occurs and how to resolve the Apex language server error that we face in the VS Code editor.
You may like to read:
- Assignee does not have permission to view cases in Salesforce
- Add User to Group or Permission Set Using Salesforce Apex
- New Button Missing on Campaigns in Salesforce
- New Button Missing on Account Object in Salesforce
- Integration License Not Displaying While Creating Integration User in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.