Where to put wrapper.java.command that was in wrapper.conf?

  • What version are you upgrading from? 8.9
  • System information RH 7.9, OpenJDK 17
  • What’s the issue you’re facing

We used to point out the openjdk in the wrapper.conf but now it has been removed in the 9.9 release.
Where do I put such info so we can start with the openjdk 17?

br.

//mikael

Hi,

From https://docs.sonarqube.org/latest/setup-and-upgrade/install-the-server/ :

Adjusting the Java installation
By default, the scripts will use the Java executable available in the PATH. If there are multiple versions of Java installed on your server, you may need to explicitly define which version of Java is used.

It is possible to overwrite the default Java executable by setting the environmental variable SONAR_JAVA_PATH.

Linux
export SONAR_JAVA_PATH="path/to/java_home/bin/java"

1 Like

Hi again,

Since we use a service on RH. We set it up in service file:

[Unit]
Description=SonarQube service
After=syslog.target network.target

[Service]
Type=forking
Environment="SONAR_JAVA_PATH=/path-to-install/17.0.6/bin/java"
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
LimitNOFILE=131072
LimitNPROC=8192
User=sonarqube
Group=sonarqube
Restart=on-failure

[Install]
WantedBy=multi-user.target


Then when I restart I see the following:

sudo systemctl status sonarqube.service
● sonarqube.service - SonarQube service
   Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Mon 2023-02-20 12:51:25 CET; 13s ago
  Process: 2108 ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop (code=exited, status=0/SUCCESS)
  Process: 1981 ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start (code=exited, status=0/SUCCESS)
 Main PID: 2022 (code=exited, status=0/SUCCESS)

Feb 20 12:51:25 company-server sonar.sh[1981]: OpenJDK Runtime Environment Zulu17.40+19-CA (build 17.0.6+10-LTS)
Feb 20 12:51:25 company-server sonar.sh[1981]: OpenJDK 64-Bit Server VM Zulu17.40+19-CA (build 17.0.6+10-LTS, mixed mode, sharing)
Feb 20 12:51:25 company-server sonar.sh[1981]: Starting SonarQube...
Feb 20 12:51:25 company-server systemd[1]: Started SonarQube service.
Feb 20 12:51:25 company-server sonar.sh[2108]: /app/vbuild/SLED12-x86_64/openjdk/17.0.6/bin/java
Feb 20 12:51:25 company-server sonar.sh[2108]: openjdk version "17.0.6" 2023-01-17 LTS
Feb 20 12:51:25 company-server sonar.sh[2108]: OpenJDK Runtime Environment Zulu17.40+19-CA (build 17.0.6+10-LTS)
Feb 20 12:51:25 company-server sonar.sh[2108]: OpenJDK 64-Bit Server VM Zulu17.40+19-CA (build 17.0.6+10-LTS, mixed mode, sharing)
Feb 20 12:51:25 company-server sonar.sh[2108]: Gracefully stopping SonarQube...
Feb 20 12:51:25 company-server sonar.sh[2108]: Removed stale pid file: ./SonarQube.pid

Any idea why it shuts down?