Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salesforcedx-vscode-apex does not accept versions of Java greater than 8 #930

Closed
darrenjaneczek opened this issue Apr 25, 2018 · 22 comments
Closed

Comments

@darrenjaneczek
Copy link

Summary

Attempting to use Apex extension, requires JDK 8. JDK 9 and JDK 10 are not sufficient.

Steps To Reproduce:

  1. Do not have JDK 8 installed, but have a later JDK 9 or JDK 10 version installed.
  2. Open the extension.
  3. Observe declaration that version 8 is required.

Expected result

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"
.

Actual result

I could not get the extension to work until JDK 8 was installed.

Additional information

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

@vazexqi
Copy link
Contributor

vazexqi commented Apr 25, 2018

@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.

@ShriPunta
Copy link

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?

@ShriPunta
Copy link

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

@vazexqi
Copy link
Contributor

vazexqi commented Sep 7, 2018

Just as an FYI about JDK LTS support: https://twitter.com/joshbloch/status/1037457645089812482

@ntotten ntotten transferred this issue from forcedotcom/salesforcedx-vscode Jan 28, 2019
@ntotten ntotten transferred this issue from another repository Jan 28, 2019
@ntotten ntotten added this to the Winter `19 milestone Jan 28, 2019
@gdoenlen
Copy link

gdoenlen commented Feb 11, 2019

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.

@ntotten
Copy link
Contributor

ntotten commented Feb 11, 2019

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.

@gdoenlen
Copy link

Thanks Nathan! I'll update and let you know if I run into anything unexpected.

@ntotten ntotten removed this from the Winter `19 milestone Mar 21, 2019
@shillem
Copy link

shillem commented Apr 19, 2019

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?

@praksb
Copy link
Contributor

praksb commented Apr 23, 2019

@shillem There is a draft PR in review: #1275

@TWood-IRL
Copy link

TWood-IRL commented May 24, 2019

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 ?

@TWood-IRL
Copy link

TWood-IRL commented May 24, 2019

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

openJDK

@ntotten
Copy link
Contributor

ntotten commented May 24, 2019

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.

@ntotten ntotten closed this as completed May 24, 2019
@skycafemix
Copy link

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..

@praksb
Copy link
Contributor

praksb commented Jul 9, 2019

@skycafemix Installing Java 11 should work.

@arneper
Copy link

arneper commented Oct 31, 2019

Java 11.0.5 still creating error Java 8 is require to run. Have you been able to get Java 11 to work?

@darrenjaneczek
Copy link
Author

@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!

@arneper
Copy link

arneper commented Nov 4, 2019

@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?

@ntotten
Copy link
Contributor

ntotten commented Nov 4, 2019

@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

@arneper
Copy link

arneper commented Nov 4, 2019

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!

@arneper
Copy link

arneper commented Nov 6, 2019

@ntotten this build seems to be right. Am I missing something. Thanks for the help! I hope to contribute to the project soon. Cheers

@arneper
Copy link

arneper commented Nov 12, 2019

@ntotten Should I open a new issue? Thanks.

@smlisk0630
Copy link

I'm getting this error for jdk 14. Is there a workaround for Macs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests