The error "The version of Java you have used to run this analysis is deprecated.." continue showing after updating to Java 11

Hi there!

  • ALM used: GitHub
  • CI system used: AWS CodeBuild
  • Scanner command used: dotnet sonarscanner begin /k:$SONAR_PROJECT_KEY /d:sonar.login=$SONARQUBE_PROJECT_GUID /$SONAR_URL /o:$SONAR_Organization /d:sonar.cs.opencover.reportsPaths=$BUILD_PATH/test/$UNITTEST_PROJECT/coverage.opencover.xml /d:sonar.coverage.exclusions="/test/"
  • Languages of the repository: c#
  • Error observed: “The version of Java (1.8.0_242) 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.”
  • Steps to reproduce:
  • in my build scripts I update the Java verstion before running the sonnarscanner command by: apt-get update && apt-get install openjdk-11-jdk -y && java -version
  • the run the Scanner command listed above and as the result still have that Warning about deprecated Java version

Can you help me to understand what am I doing wrong and what Java should I update ?


this is the log from the AWS CodeBuild build

Hi @olgasavchuk

Could you echo JAVA_HOME env variable just before issuing the dotnet sonarscanner command ?

If this is ran in an underlying bash or something like this, this variable may be not available or at its previous value, ie java 8


This is my log before running the sonarscanner command

This is my branch in SonarCloud

Juat figured out the issue. I’m calling the sonarscanner end command from another bash script and JAVA_HOME there still points to 1.8 version


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.