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.
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.
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.