_Attempting to use Apex extension, requires JDK 8. JDK 9 and JDK 10 are not sufficient_.
_I would have expected that one of the later JDK versions would be sufficient for
the requirement of "Java 8 Platform, Standard Edition Development Kit"_.
_I could not get the extension to work until JDK 8 was installed_.
_I am curious -- is there a technical reason why specifically JDK8 is acceptable, but
the later versions are not? I would love to know. The work-around (i.e., installing the exact requirement) isn't too inconvenient, but comes at a bit of a surprise -- seems like it should be avoidable when a later SDK version is installed_.
VS Code Version:
Version 1.22.2
SFDX CLI Version:
salesforcedx-vscode-apex v42.12
OS and version:
macOS 10.13.4
@darrenjaneczek - The current plan is that we will start supporting it when Java 10/11 comes out (slated later this year). Java 9 is not meant to be a LTS version of Java so we don't want to unnecessarily commit to it. https://github.com/forcedotcom/salesforcedx-vscode/issues/139#issuecomment-358843211 has more details on the error.
I'll revisit this with the compiler team though and post any updates.
Facing the same issue.
Is there a workaround for this?
I have jdk-9.0.1
and jre-10.0.1
And it gives me the error on starting VS code.
Do i have to downgrade my JRE and JDK?
Did a workaround where I did a manual override in my user settings and changed the path for the Java JDK.
"salesforcedx-vscode-apex.java.home": "C:/Users/../../JDK8
Just as an FYI about JDK LTS support: https://twitter.com/joshbloch/status/1037457645089812482
Is there any reason why this is still delayed? From looking at the plugin source and the decompiled jar source it seems to be an arbitrary requirement. Any JVM > 8 should provide backwards compatibility to run the byte code and JDK 11 has been the LTS release since September 2018.
An update on this. The latest release of the extensions _should_ support JDK 11. That being said, it hasn't been fully tested so we aren't saying it is officially supported. If you are ambitious, you can try it out. If you encounter bugs, please open issues here.
Thanks Nathan! I'll update and let you know if I run into anything unexpected.
An update on this. The latest release of the extensions _should_ support JDK 11. That being said, it hasn't been fully tested so we aren't saying it is officially supported. If you are ambitious, you can try it out. If you encounter bugs, please open issues here.
It should was back in February. To date it doesn't. I even forced the salesforcedx-vscode-apex.java.home param to take the new JDK but the extension fires the warning (JDK8 required) and no Apex Language Server is started. Am I missing something?
@shillem There is a draft PR in review: https://github.com/forcedotcom/salesforcedx-vscode/pull/1275
Just noticing on https://forcedotcom.github.io/salesforcedx-vscode/articles/troubleshooting
It mentions JDK version 8 or JDK version 11.
However using JDK 11 I still receive an error that JDK 8 is needed
Is this still not supported or is there any update ?
Think I see my problem
Looking here
https://github.com/forcedotcom/salesforcedx-vscode/blob/master/packages/salesforcedx-vscode-apex/src/requirements.ts
line 86
javaHome + '/bin/java', ['-version'], {},
(error, stdout, stderr) => {
if (
stderr.indexOf('build 1.8') < 0 &&
stderr.indexOf('build 11.') < 0
) {
reject(nls.localize('wrong_java_version_text', SET_JAVA_DOC_LINK));
} else {
resolve(true);
}
}
I'm using openJDK and it looks like my output is different
We support JDK 11 now and will continue to support new versions as they are released.
@Londoner1234 I'm moving your issue to #1363 as it is a different problem than this original post. Thanks for reporting, we will get it fixed asap.
My 2019 Mac comes with Java 12 but not supported. (Salesforcedx-vscode-apex requires java 8)
Now I wonder can I install Java 11 or do I have to downgrade all the way to 8 for vscode..
@skycafemix Installing Java 11 should work.
Java 11.0.5 still creating error Java 8 is require to run. Have you been able to get Java 11 to work?
@darrenjaneczek - The current plan is that we will start supporting it when Java 10/11 comes out (slated later this year). Java 9 is not meant to be a LTS version of Java so we don't want to unnecessarily commit to it. #139 (comment) has more details on the error.
I'll revisit this with the compiler team though and post any updates.
Thanks @vazexqi for the clarification. It wasn't until recently, I realized how much "backward compatibility" with certain features was sacrificed (or complicated) after Java 8, after trying to compile some code using Java 11, targeted for Java 8. Apologies for my confusion.
Since the Eclipse force.com officially retired last month, I've recently started getting into the swing of salesforcedx-vscode, and have been enjoying it thoroughly.
Thanks to your team!
@darrenjaneczek - The current plan is that we will start supporting it when Java 10/11 comes out (slated later this year). Java 9 is not meant to be a LTS version of Java so we don't want to unnecessarily commit to it. #139 (comment) has more details on the error.
I'll revisit this with the compiler team though and post any updates.Thanks @vazexqi for the clarification. It wasn't until recently, I realized how much "backward compatibility" with certain features was sacrificed (or complicated) after Java 8, after trying to compile some code using Java 11, targeted for Java 8. Apologies for my confusion.
Since the Eclipse force.com officially retired last month, I've recently started getting into the swing of salesforcedx-vscode, and have been enjoying it thoroughly.
Thanks to your team!
I guess I'm confused. Your documentation says 11 is working. Yet when I get it from sources listed it still requires 8. So, is the documentation not updated to reflect that in fact there are too many issues to support 11?
@arneper Java 11 is supported. Can you tell me specifically which version you have installed by running java --version. Some builds produce different formats for the build number and we don't detect them. However, if you follow these instructions and install one of the supported versions it should work with version 11. https://developer.salesforce.com/tools/vscode/en/getting-started/java-setup
hi @ntotten . Java version bellow, That is the documentation I was referencing. The latest 11 builds have changed the directory format adding a '-'.
java version "11.0.5" 2019-10-15 LTS S)
Java(TM) SE Runtime Environment 18.9 (build 11.0.5+10-LTLTS, mixed mode)S)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode)
BTW congrats on launch of SOQL code completion release.
Thanks for the help!
@ntotten this build seems to be right. Am I missing something. Thanks for the help! I hope to contribute to the project soon. Cheers
@ntotten Should I open a new issue? Thanks.
Most helpful comment
Did a workaround where I did a manual override in my user settings and changed the path for the Java JDK.
"salesforcedx-vscode-apex.java.home": "C:/Users/../../JDK8