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 17 is mis-identified as Java 8

See original GitHub issue

Error message in VS Code (Source: Spring Boot Tools (Extension)):

Spring Tools Language Server requires Java 11 or higher to be launched. Current Java /opt/java/17.0.1/bin/java. (Note Java 8 can still be used in your own projects. Java 11 is only required to launch the Spring Tools Language Server process)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
martinlippertcommented, Jan 10, 2022

This is the strategy that the extension uses:

  • look for the Spring Boot extension specific preference (spring-boot.ls.java.home)
  • look for the Java Language Extension preference for the JDK (java.home)
  • look for the JAVA_HOME env variable
  • look for the PATH env variable

The problem might be that the check for the JDK >= 11 happens after this strategy found a JDK (from top to bottom), it does not continue the search if one of the found JDKs is < 11. In your case it looks like the first two options are not set, then JAVA_HOME is found pointing to a JDK and is used, but then recognized as JDK < 11.

So we could improve the strategy to continue the search if the found JDK is not >= 11 as well as add additional locations to the list of searched locations. WDYT?

0reactions
martinlippertcommented, Feb 15, 2022

@dsyer Any feedback from the Codespaces team about the wrong JDK appearing on the JDK17 path?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java 17 features: A comparison between versions 8 and 17
Java has changed considerably over last few years. Read about Java 17 features and get insight on upgrading your Java to version 17...
Read more >
Compatibility Guide for JDK 8 - Oracle
This document discusses types of potential incompatibilities relating to the JDK 8 release of the Java platform.
Read more >
How to Change Java Versions in Windows (Updated for JDK 18)
How to install multiple Java versions on Windows in parallel? ... Java SE 17 / OpenJDK 17 (→ The most important new features...
Read more >
Why and How to Upgrade to Java 16 or 17 - InfoQ
Java 17, the next Long Term Support (LTS) release, will be released on September 14, 2021. This article explains why you should upgrade...
Read more >
Java -version shows java 8 while java 11 is installed
4. look at your PATH environment variable. · 3. Open a Windows command prompt window and type the command where java . ·...
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