Could not find 'java' executable in JAVA_HOME or PATH (but it is correctly set)

Answer to myself (may help others):

By enabling the debug mode i was able to progress and notice that the task was not using the agent variables expected (even if defined correctly everywere, like in /etc/profile, .bashrc, forced by a shell step before the SQ step).

##[debug]SONARQUBE_SCANNER_MODE=MSBuild
##[debug]JAVA_HOME=/usr/lib/jvm/java-14-openjdk-14.0.1.7-2.rolling.el7.x86_64
##[debug]JAVA_HOME_11_X64=undefined

Fun fact: i can’t find this version of java on my agent…

But in the agent capability the java_home is indeed wrong:

In theory the agent should refresh this value by taking it from the OS, and in my case it doesn’t…

After many attempts to have the JAVA_HOME correctly detected, i have finally an alternate solution, by setting in the user defined capabilities the JAVA_HOME_11_X64 variable.

:rocket: