question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Java Version Detection doesn't work on all version strings

See original GitHub issue

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

_Originally posted by @Londoner1234 in https://github.com/forcedotcom/salesforcedx-vscode/issues/930#issuecomment-495531429_

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
shillemcommented, May 24, 2019

Please, consider adding 12 already since it’s GA

1reaction
sogeisetsucommented, Apr 15, 2022

Please, consider adding 12 already since it’s GA

@shillem OH ! NO !I tried to use the GA version of openjdk11 and the GA version of openjdk17, but it didn’t work, I also used the build 11.0.2+9 version of openjdk, luckily it worked. When I change to Oraclejdk11 or Oraclejdk17, it works fine.

There is one thing I don’t understand, is there any logic for salesforcedx-vscode in the selection of supported openjdk versions? Why does not support the GA version of opengdk ? @shillem GA clearly means General Availability, which represents the officially released version, the official began to recommend widespread use.

I got openjdk from this website👉https://jdk.java.net/archive/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version Comparison in Java - Baeldung
In this article, we'll explore a few ways to compare version strings in Java through various libraries.
Read more >
java --version doesn't work in the command line - Stack Overflow
So, I uninstalled the previous versions, restarted and then installed fresh jdk 7u5 windows i586. Still I get the same problem. Can anyone...
Read more >
Java version detected but couldn't parse version from ... - GitHub
Try installing Java 8. If that doesn't just work, set the JAVA_HOME environment variable.
Read more >
How to Change Java Versions in Windows (Updated for JDK 18)
Step 1: Installing Multiple Java Versions. Installing multiple Java versions in parallel is incredibly easy in Windows. You can download and run the...
Read more >
How to find Java version in Windows or Mac - Manual method
Under the General tab in the Java Control Panel, the version is available through the About section. A dialog appears (after clicking About)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found