- Operating system:Lin
- IDE name and flavor/env: VSCode
- SonarLint plugin version: v3.5.3
- Is connected mode used: unrelated
And a thorough description of the problem / question:
The documentations says you need JRE
However, it also states you need
javac is in JDK and not JRE!
You’ll notice that
javac is not used directly, but simply as another way to potentially find a JRE (since a JDK is a superset of JRE). So you still don’t need a JDK, but if you have one installed and SonarLint can discover it, it will try and find the associated runtime based on that discovery.
But SonarLint cannot discover a JRE installation. I would have to configure 1,2 or 3 to find it
At least this is what happened in my devcontainer.
Do you mean that SonarLint for VSCode does not behave as expected ? Are you in a case that is documented and should your Java installation be automatically detected ?
As a side note, we are working on embedding a small JRE in the extension so that users don’t have to worry about it, it should work out of the box. This change is supposed to come soon, see this ticket.
I am not sure what you mean…
The reproduction is (I have not tried this exactly we have way more infrastucture… e.g. wsl):
- Have linux with docker and vscode
- create new project
- Install remote containers extension
- Add basic devcontainer,json file (e.g. with debian image)
- Reopen project in a container
- install jre (in container, e.g
apt install openjdk-17-jre-headless)
- Install SonarLint extension (in container)
→ Message JRE not found will appear.
Is this not a valid use case?
Given your setup, and given the current detection algorithm in SonarLint VSCode, I think indeed you will have to use option 1 or 2 or 3 to help SonarLint detect the JRE.
There are probably solutions we could use to improve our detection algorithm for the JRE to be automatically picked, as mentioned earlier we plan to embed the JRE which will simplify the configuration even more.
Hope this helped
Thanks. In the meantime I will just install JDK which is easier for now
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.