Warning about Java version in Azure Pipelines build

Hi,

I’m using the Azure Pipelines analysis (which BTW is very convinient!) and for sometime now I’m seeing this warning:
“The version of Java (1.8.0_251) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.”

I’ve checked the Azure Pipelines task and I can’t see any new version that could be replacing the existing one, so I’m guessing this update Java is still to happen on the task.

Can someone please confirm, or point me on instructions on how to “fix” this?

Thanks!

Hi @josesimoes and welcome to the community !

We are referring here to the version of Java runtime used to run the analysis. Do you run your own build agent ? If yes, you should upgrade to at least Java 11 (which you can grab on adoptopenjdk for example), then replace your JAVA_HOME environment variable to point to that new installation, restart the agent, and you should be good to go !

HTH,
Mickaël

Hey @mickaelcaro!

(thanks for warm welcome :slight_smile: )

Nope, this is running as part of a build on Azure Pipelines standard agent. VS2017 image.
I can see from here that there are a number of Java environments installed on the VM:

If I’m not mistaken the analysis is part of one of the Sonar Azure tasks. Maybe that can be improved to make it smarted and point to a recent Java version, when available…

Thanks,

If you run the analysis witth system.debug = true (pipeline variable), do you see this kind of messages in the beginning of the Run Code Analysis task log ?

JAVA_HOME_11_X64 path has been detected, switching to it for the analysis.

Please check here the log for a build that I’ve just run with debug ON

Sounds like this is ok now. Do you still have the message when you disable the debug mode ?

I’ve just run it on another repo, and I get this:

but yes, the warning is not showing anymore for new builds