JRE fatal error when running sonar-scanner

which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

  • SonarQube Enterprise Edition Version 8.1 (build 31237)
  • Sonar Scanner CLI 4.2.0.1873-macosx

what are you trying to achieve
Running Sonar Scanner

what have you tried so far to achieve this

  • Install SonarQube Enterprise Edition, add the trial license key
  • Setup a project on SonarQube
  • Run the SonarScanner

Other notes
Previously, it works when I tested using Community edition. Now, event sonar-scanner -h return error.

I see there are JRE version: (11.0.3+7) on the error message. When I check java --version in my terminal, it returns:

java 11.0.4 2019-07-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

I only enable below config on conf/sonar-scanner.properties:

#----- Default SonarQube server
sonar.host.url=http://localhost:9000

Error messages

sonar-scanner \       
  -Dsonar.projectKey=ph-connect \
  -Dsonar.sources=docroot/modules/custom,docroot/themes/custom \
  -Dsonar.host.url=http://localhost:9000 \
  -Dsonar.login=6456dbc86174c578ee8e30d6ada8a9a6a6fa5b72
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fff738c86f2, pid=3345, tid=6659
#
# JRE version:  (11.0.3+7) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.3+7, mixed mode, aot, sharing, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# C  [libsystem_platform.dylib+0x16f2]  _platform_strlen+0x12
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/permana.jayanta/Sites/jnjapacb30d10-dev/hs_err_pid3345.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-build/issues
#
[1]    3345 abort      sonar-scanner -Dsonar.projectKey=ph-connect  

Log attached: hs_err_pid3345.log.txt (29.0 KB)

Solved by editing bin/sonar-scanner file.
Open it in text editor, and change from
use_embedded_jre=true to use_embedded_jre=false

1 Like