Skip to content

Spring Boot Tools for VS Code incorrectly misidentifies internal JDK for Language Support for Java as a JRE #715

New issue

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

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

Already on GitHub? # to your account

Closed
alvint opened this issue Jan 17, 2022 · 2 comments
Labels
for: vscode something that is specific for VSCode type: enhancement

Comments

@alvint
Copy link

alvint commented Jan 17, 2022

Now that Language Support for Java is platform-specific, it embeds a JDK by default. On my linux VM (which I connect to via Remote-ssh), the path to this JDK is ~/.vscode-server/extensions/redhat.java-1.2.0/jre/17.0.1-linux-x86_64/.

However, if I try to use this JDK for Spring Boot Tools by setting spring-boot.ls.java.home, it complains that it's a JRE (see picture). My guess is the extension is simply checking the path for the string "jre" to determine if it's a JRE or JDK.

The way I see it, there are two issues that need to be addressed:

  • a more robust check needs to be done to determine if the folder is a JDK or JRE
  • since Spring Boot Tools requires Language Support for Java, and Language Support for Java now includes a JDK by default, Spring Boot Tools should scan for and automatically use this JDK by default, if it's not overridden by spring-boot.ls.java.home (OK, this part is more of an enhancement)

To reproduce, set spring-boot.ls.java.home to a JDK whose path includes the string "jre".


Screen Shot 2022-01-13 at 08 20 51

@alvint alvint changed the title Spring Boot Tools for VS Code incorrectly misidentifies default Language Support for Java JDK as a JRE Spring Boot Tools for VS Code incorrectly misidentifies internal JDK for Language Support for Java as a JRE Jan 17, 2022
@BoykoAlex
Copy link
Contributor

@kdvolder and I fixed it:

  • Better criteria for JDK d71b70b
  • Use embedded JDK into java ls if it is around 29db241

@alvint
Copy link
Author

alvint commented Feb 4, 2022

Works great here. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
for: vscode something that is specific for VSCode type: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants