And this is the status of sonarqube(the port of sonarqube is 4950):
sudo systemctl status sonarqube.service
× sonarqube.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-07-18 12:43:37 CEST; 11s ago
Process: 5936 ExecStart=/bin/nohup /opt/java/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /op>
Main PID: 5936 (code=exited, status=127)
CPU: 3ms
Jul 18 12:43:37 ubuntu-vm systemd[1]: sonarqube.service: Scheduled restart job, restart counter is at 5.
Jul 18 12:43:37 ubuntu-vm systemd[1]: Stopped SonarQube service.
Jul 18 12:43:37 ubuntu-vm systemd[1]: sonarqube.service: Start request repeated too quickly.
Jul 18 12:43:37 ubuntu-vm systemd[1]: sonarqube.service: Failed with result ‘exit-code’.
Jul 18 12:43:37 ubuntu-vm systemd[1]: Failed to start SonarQube service.
I’d like to know if there’s something wrong and how could i fix this problem.
Inside the nohup.log file displays the following error:
Error: LinkageError occurred while loading main class org.sonar.application.App
java.lang.UnsupportedClassVersionError: org/sonar/application/App has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Java 17 is required to run the server. If you need to have multiple versions of Java installed on your server, you can adjust the SONAR_JAVA_PATH environment variable to point to the correct one for SonarQube to use at startup.
Your error message indicates that SonarQube is only finding Java 11.
We solved the problem, the sonarqube.service is active. But we still couldn’t launch sonarqube, whatever we use http or https connection (of course plus port number).
Here’re some configuration files.
In the “/etc/sysctl.conf” file we added these lines:
m.max_map_count=262144
fs.file-max=65536
ulimit -n 65536
ulimit -u 4096
In the “/etc/systemd/system/sonarqube.service” file we added:
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
User=sonar
Group=sonar
Restart=always
LimitNOFILE=65536
LimitNPROC=4096
[Install]
WantedBy=multi-user.target
If you’re starting SonarQube from the service, maybe /opt/sonarqube is pointing to another installation on the same machine, rather than your new SonarQube 10.6 install?
Is this server precious? Something tells me you’ll have a lot better luck just starting from scratch.