如果沒有java
sudo apt update
sudo apt install openjdk-11-jre-headless
###安裝
mkdir ~/sonar-scanner
cd ~/sonar-scanner
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
unzip sonar-scanner-cli-*.zip
載入設定
echo 'export PATH="$PATH:~/sonar-scanner/sonar-scanner-cli-4.6.2.2472-linux/bin"' >> ~/.bashrc
source ~/.bashrc
測試
sonar-scanner -v