Sonar-scanner --define sonar.projectVersion=1.0 Could not find 'java' executable in JAVA_HOME or PAT

I am getting error when I run “./run-sonar-swift.sh -v” command.
Error is:

\nComputing coverage report\n

Command line exclusion flags for slather is:

slather coverage --binary-basename SonarDemo --input-format profdata --cobertura-xml --output-directory sonar-reports --scheme SonarDemo SonarDemo.xcodeproj

+ slather coverage --binary-basename SonarDemo --input-format profdata --cobertura-xml --output-directory sonar-reports --scheme SonarDemo SonarDemo.xcodeproj

Slathering...

Slathered

+ returnValue=0

+ set +x

Running SwiftLint...Error: Unknown option '--path'

Usage: swiftlint lint [<options>] [<paths> ...]

See 'swiftlint lint --help' for more information.

Running Tailor...Skipping OCLint (test purposes only!)

Skipping FauxPas

Skipping Lizard (not installed!)

Running SonarQube using SonarQube Runner

+ sonar-scanner --define sonar.projectVersion=1.0

Could not find 'java' executable in JAVA_HOME or PATH.

+ returnValue=1

+ set +x

ERROR - Command 'sonar-scanner --define sonar.projectVersion=1.0' failed with error code: 1

I am running SonarQube on Mac M4.

Hi,

Welcome to the community!

This is not our script. However, it looks like you can bypass that error by defining sonar.projectVersion in your properties file.

You might want to file a bug with the maintainers.

 
HTH,
Ann