I am getting the above error when opening VS Code on Mac OS. When I run java -version I get the following output.
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
@joshua-nicholson - It seems that you have Java 11 installed. The version is indicated from 11.0.1. The Apex code completions won't work with Java 11 yet. We are working on this.
For the time being, could you install Java 8 from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
If you need to have both Java 11 and Java 8 installed, you can set the salesforcedx-vscode-apex.java.home setting to point to it. See https://github.com/forcedotcom/salesforcedx-vscode/wiki/Apex-Language-Server#how-do-i-configure-the-version-of-java-that-the-apex-language-server-uses for more information.
I'm closing this issue for now since I've provided the steps on how to resolve this known limitation. Please feel free to re-open if you encounter any other issues.
The Troubleshooting documentation that answers this question is now hosted at https://forcedotcom.github.io/salesforcedx-vscode/articles/troubleshooting.
Most helpful comment
@joshua-nicholson - It seems that you have Java 11 installed. The version is indicated from 11.0.1. The Apex code completions won't work with Java 11 yet. We are working on this.
For the time being, could you install Java 8 from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
If you need to have both Java 11 and Java 8 installed, you can set the
salesforcedx-vscode-apex.java.homesetting to point to it. See https://github.com/forcedotcom/salesforcedx-vscode/wiki/Apex-Language-Server#how-do-i-configure-the-version-of-java-that-the-apex-language-server-uses for more information.I'm closing this issue for now since I've provided the steps on how to resolve this known limitation. Please feel free to re-open if you encounter any other issues.