And a thorough description of the problem / question:
I’ve just switched from an Intel Surface to an Arm Surface, i.e. running Windows on Arm. I’m also using WSL to run Ubuntu 24.04.
Any attempt to use the extension results in two errors:
SonarLint Language Server client: couldn’t create connection to server.
The Java Runtime Environment can not be located. Please install a JRE, or configure its path with the sonarlint.ls.javaHome property.
My question, initially at least, is about the JRE error. Where is it looking? On Windows or in Ubuntu? I’ve installed a jre in Ubuntu and it is accessible at /usr/bin/java so I would expect it to be found.
Or does it not work with Arm systems under Windows?
Windows on Arm is not officially supported, but it should work.
The bulk of the work is done by the underlying language server, which is based on LSP4J and requires a Java 17+ runtime. For officially supported platforms, the extension ships its own runtime.
For platforms like Windows on Arm that rely on the “universal” package, the extension:
First checks if the sonarlint.ls.javaHome property is set
Then, tries to find a suitable Java runtime through a few heuristics (PATH environment variable, JAVA_HOME, etc.)
Then, it should offer to download one from the Adoptium project
I don’t understand why both the auto-detection and download seem to fail, and unfortunately I don’t have access to an Arm Surface device to reproduce but explicitly setting sonarlint.ls.javaHome should do the trick.
Where to set it depends on your setup:
If your workspace folders are on the native Windows file system, the variable should be set in your “User” settings and point to a Windows Arm JRE
If your workspace folders are on the WSL Ubuntu file system, you should be using the WSL extension, the variable should be set in the “Remote” settings and point to a JRE usable by the WSL image; running uname -a in WSL should give you the supported architecture(s)
In both cases, sonarlint.ls.javaHome should point to the directory that contains the whole JRE, i.e. a directory that contains a bin directory that itself contains a java executable.
Out of curiosity, what is your main reason for using WSL?
In case anyone else has the same problem, installing JRE on Ubuntu works but it is necessary to configure JAVA Home in the “Remote” settings of the extension. On my system, the path was /usr/lib/jvm/java-21-openjdk-arm64. Once that was done, I reloaded the workspace and both messages then stopped appearing.
Out of curiosity, what is your main reason for using WSL?
I prefer to use Windows as my day-to-day operating system but we build code that is running on Linux systems so it is better for me to have a closer experience to the running environment than try to develop & build within Windows.