SonarQube 7.9 Unable to Start: Java Error Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch


OS: CentOS 6.6 64-Bit
Java: OpenJDK 11
SonarQube: Version 7.9.2
User: sonar

As the user “sonar”, I try to start SonarQube and I get this error message in the log.

Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
java.lang.IllegalStateException: Future got interrupted

I’m pretty sure this is an easy fix related to the wrong version of Java or the path to Java but I can’t seem to find out what I am doing wrong. Would anyone happen to know what the issue is?

Does anyone have any idea on what the error could be?

JAVA_HOME is set. The user sonar starts the SonarQube and Elastic Search process.


Welcome to the community!

It’s not clear to me whether or not your SQ instance is starting up despite this error. If not, could you provide the full stacktrace from the log and a few lines before it starts?


I just tried starting from scratch again:

OS: RedHat 7.7 (Fresh, minimal install)
Java: OpenJDK 11 (yum install java-11)
SonarQube: Version 7.9.2
User: sonar

I unzipped the file and I am trying to do the 2 minute install as per these instructions.

SonarQube is not even starting. The only error log that is generated is sonar.log and the error is:
Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch

Hi, please provide the full logs as files. Could you please as well compute a md5 hash on the zip you downloaded ? you should get 600f9174417514d2040630a4ef472124

–> Wrapper Started as Daemon
Launching a JVM…
Wrapper (Version 3.2.3)
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.

2020.01.10 14:21:58 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /home/sonar/Downloads/sonarqube-7.9.2/temp
2020.01.10 14:21:58 INFO app[] Elasticsearch listening on /
2020.01.10 14:21:58 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/home/sonar/Downloads/sonarqube-7.9.2/elasticsearch]: /home/sonar/Downloads/sonarqube-7.9.2/elasticsearch/bin/elasticsearch
2020.01.10 14:21:58 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Java HotSpot™ 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.01.10 14:21:58 INFO app[o.e.p.PluginsService] no modules loaded
2020.01.10 14:21:58 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.bootstrap.Elasticsearch
2020.01.10 14:21:58 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.01.10 14:21:58 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2020.01.10 14:21:58 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
2020.01.10 14:21:59 INFO app[o.e.c.t.TransportClientNodesService] failed to get node info for {#transport#-1}{AWCQ6U8ES-a_1s-IeiFM-A}{}{}, disconnecting…
java.lang.IllegalStateException: Future got interrupted
at org.elasticsearch.common.util.concurrent.FutureUtils.get(
at org.elasticsearch.transport.ConnectionManager.internalOpenConnection(
at org.elasticsearch.transport.ConnectionManager.openConnection(
at org.elasticsearch.transport.TransportService.openConnection(
at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(
at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(
at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(
at org.elasticsearch.client.transport.TransportClient.addTransportAddress(
at org.sonar.application.process.EsManagedProcess.checkStatus(
at org.sonar.application.process.EsManagedProcess.checkOperational(
at org.sonar.application.process.EsManagedProcess.isOperational(
at org.sonar.application.process.ManagedProcessHandler.refreshState(
at org.sonar.application.process.ManagedProcessHandler$
Caused by: java.lang.InterruptedException: null
at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(
at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(
at org.elasticsearch.common.util.concurrent.BaseFuture.get(
at org.elasticsearch.common.util.concurrent.FutureUtils.get(
… 17 common frames omitted
<-- Wrapper Stopped

The only log file generated is sonar.log. It doesn’t even get to the part where it generates the es.log or web.log or ce.log

Ok. I figured it out. The MD5 for the SonarQube zip file that I downloaded did not match. I downloaded SonarQube again and now it works.