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 · 14 comments

Comments

@darrenjaneczek
Copy link

commented Apr 25, 2018

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

commented Jun 14, 2018

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

This comment has been minimized.

Copy link

commented Jun 14, 2018

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

This comment has been minimized.

Copy link
Member

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 forcedotcom/web-tools Jan 28, 2019

@ntotten ntotten added this to the Winter `19 milestone Jan 28, 2019

@gdoenlen

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

commented Feb 11, 2019

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Collaborator

commented Apr 23, 2019

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

@londoner1234

This comment has been minimized.

Copy link

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 ?

@londoner1234

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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 May 24, 2019

@skycafemix

This comment has been minimized.

Copy link

commented Jul 7, 2019

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

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

@skycafemix Installing Java 11 should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.