while trying to initiate a sonar scan from Bitrise, I encountered the error “The version of Java (1.8.0_292) you have used to run this analysis is deprecated and we stopped accepting it.
Please update to at least Java 11”. My Java environment in Bitrise shows everything has java version 11. Need some help here.
Steps in my Bitrise pipeline:
added a script step before my sonarscanner step.
Content of script step
#!/bin/bash
set -ex
add-apt-repository -y ppa:openjdk-r/ppa
apt-get update -qq
apt-get install -y openjdk-11-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
sudo update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
java -version
javac -version
echo $JAVA_HOME
This step sets java version 11.