Open an Apex class in VS Code on a machine without a usable Java, and the Problems panel shows this:
Unable to activate the Apex Language Server - Java runtime could not be located. Set one using the salesforcedx-vscode-apex.java.home VS Code setting. For more information, go to Set Your Java Version.
The Apex extension can’t start because it can’t find a JDK. Install JDK 21, set salesforcedx-vscode-apex.java.home to the JDK folder (not java.exe), then close and reopen VS Code. That cleared the error in every case I reproduced on Windows 11 with Salesforce Extension Pack 68.4.0.
Below you will match your exact message to its cause, apply the fix, and confirm that unable to activate the Apex Language Server is gone for good.
Why the Apex Language Server needs Java
The Apex Language Server gives VS Code class outlines, code completion and syntax