You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
STS4 does not detect Fedora's JDK 11 as a JDK #530
When I run STS4 under Fedora's (definitely a JDK) JDK 11, it does not detect it as such and shows
The JRE you are running Eclipse with appears to not be a JDK.
Spring Boot Live Hovers will not work with a plain JRE.
This happens whether the STS4 platform bundle is used, or using it as a plugin in either Fedora's Eclipse packaging or eclipse.org's Eclipse.
On Fedora 32/33 if I set -vm to Azul or AdoptOpenJDK 11 it is indeed detected correctly and STS4 runs normally.
Some questions:
What technical means does STS4 use to detect if the JRE is a JDK?
Any ideas why a JDK is not detected as such? BTW I have definitely installed the java-11-openjdk-devel package, and Eclipse runs non-STS4 projects fine.
From this screenshot though, are live hovers actually working?
Hey @space88man! To me it looks like this JRE vs JDK check doesn't work correctly in your environment and we need to fix that.
To provide a bit of background:
There is a language server process being kicked-off in the background when you work with Spring Boot projects. This language server is written in Java and runs on the same JDK/JRE than your IDE. The language server uses specific classes for certain features (com.sun.tools.attach classes to connect to running Spring apps and retrieve live data from them). In the JDK <= 8 world, these classes are part of the tools.jar, which was only included in the JDK, not the JRE distributions. The language server itself can still work just fine on a JRE without those classes, but it will disable the feature that requires those classes to be around. In order to inform our users about this specific situation, we implemented this check for a JRE vs a JDK. That is the dialog you are seeing.
In the JDK >= 9 world, this is slightly different, since there is no tools.jar around anymore. Instead, those classes are part of the jdk.management module. Therefore the check tries to check whether that module is around in your JRE/JDK install or not. This doesn't seem to work correctly in your case.
Can you take a look at your JDK/JRE install to see where the modules are being located and where the jdk.management might be? I've seen a case (on macOS) where there is no jmod file, but instead some dylib files in the lib directory.
Thank you @martinlippert ; you have pointed me in the right direction to fix an annoyance of my own contriving by omitting to install java-11-openjdk-jmods.
Perhaps I could suggest that the error message alert the user to see if java.manamgement.jmod is installed.
Activity
martinlippert commentedon Sep 9, 2020
Hey @space88man! To me it looks like this JRE vs JDK check doesn't work correctly in your environment and we need to fix that.
To provide a bit of background:
There is a language server process being kicked-off in the background when you work with Spring Boot projects. This language server is written in Java and runs on the same JDK/JRE than your IDE. The language server uses specific classes for certain features (
com.sun.tools.attachclasses to connect to running Spring apps and retrieve live data from them). In the JDK <= 8 world, these classes are part of thetools.jar, which was only included in the JDK, not the JRE distributions. The language server itself can still work just fine on a JRE without those classes, but it will disable the feature that requires those classes to be around. In order to inform our users about this specific situation, we implemented this check for a JRE vs a JDK. That is the dialog you are seeing.In the JDK >= 9 world, this is slightly different, since there is no
tools.jararound anymore. Instead, those classes are part of thejdk.managementmodule. Therefore the check tries to check whether that module is around in your JRE/JDK install or not. This doesn't seem to work correctly in your case.Can you take a look at your JDK/JRE install to see where the modules are being located and where the
jdk.managementmight be? I've seen a case (on macOS) where there is no jmod file, but instead some dylib files in the lib directory.Independent of the check, the language server itself will use the classes and enable the live hover feature when those classes can be loaded, so the feature will still work even if the upfront check does the wrong thing. In your screenshot, the Spring Boot app doesn't seem to run, so you don't see any live hovers. Please refer to the user guide section about live hovers for more details about this feature: https://github.com/spring-projects/sts4/wiki/Live-Application-Information
space88man commentedon Sep 9, 2020
@martinlippert — wow, that's deep — followed by face palm 🤦 — Fedora has a separate package
java-11-openjdk-jmods, who knew?Results from Fedora's JDK11 - seems to be missing jmods. Could it be due to the missing
*.jmodfiles?Results from AdoptOpenJDK 11 (Zulu looks the same):
space88man commentedon Sep 9, 2020
Thank you @martinlippert ; you have pointed me in the right direction to fix an annoyance of my own contriving by omitting to install
java-11-openjdk-jmods.Perhaps I could suggest that the error message alert the user to see if
java.manamgement.jmodis installed.Thank you, again!
martinlippert commentedon Sep 9, 2020
I think that the jmod files are not really required here, therefore I modified the check also take
lib/libmanagement.sointo account.