forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
947 stars 405 forks source link

Unable to activate Apex Language Server #5872

Open superwomananmol opened 2 hours ago

superwomananmol commented 2 hours ago

Summary

As soon as i open my VS Code im flooded with error msgs: Apex Language server couldnt create connection to server; Unable to activate apex language server. on the output tab the error says: Exception in thread "main" java.lang.InternalError: Failed to load default.policy Caused by: java.nio.file.NoSuchFileException: C:\Program Files\Java\jdk-17\lib\security\default.policy my system does not contain default.policy file, instead it contains java.policy file located at C:\Program Files\Java\jdk-17\conf\security\java.policy I have added the path correctly for for java directory in the salesforcedx-vscode-apex>Java:Home property in VScode It is automatically searching in the wrong directory

Steps To Reproduce:

  1. Ensure VsCode is connected to salesforce.
  2. open VScode, you should see the error

Expected result

Describe what should have happened.

Actual result

Describe what actually happened instead.

Additional information

Feel free to attach a screenshot. image

Salesforce Extension Version in VS Code: v61.12.0

Salesforce CLI Version:2 .14.6

OS and version: Microsoft Windows 11 Enterprise 10.0.22621 N/A Build 22621

VS Code version:Version: 1.93.1 (system setup)

Most recent version of the extensions where this was working: earlier i didnt use to receive this error and one day suddenly i am getting this issue. I dont remember the exact timeline

svc-idee-bot commented 2 hours ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

svc-idee-bot commented 2 hours ago

Hello @superwomananmol :wave: It looks like you didn't provide all the required basic info in your issue.

If you haven't already, please provide the following info: Salesforce Extension Version in VS Code: Salesforce CLI Version: OS and version: VS Code version: Most recent version of the extensions where this was working:

Here's an example of a set of required info that will pass the validation: Salesforce Extension Version in VS Code: 60.13.0 Salesforce CLI Version: @salesforce/cli/2.42.6 darwin-arm64 node-v18.18.2 OS and version: MacOS Sonoma 14.5 VS Code version: 1.89.1 Most recent version of the extensions where this was working: 60.11.0

A few more things to check:

Thank you!

peternhale commented 1 hour ago

@superwomananmol Who is the vendor for the version of java you have installed?

This is my java version

java --version
openjdk 17.0.9 2023-10-17 LTS
OpenJDK Runtime Environment Microsoft-8552009 (build 17.0.9+8-LTS)
OpenJDK 64-Bit Server VM Microsoft-8552009 (build 17.0.9+8-LTS, mixed mode, sharing)

and the contents of C:\Program Files\Microsoft\jdk-17.0.9.8-hotspot\lib\

blocked.certs
cacerts
default.policy
public_suffix_list.dat