Rishi
Rishi

Reputation: 6199

Error in sonar startup, Unable to start JVM: No such file or directory (2)

I am facing strange issue with sonarqube 5.0.1 , one one of the machine it is not starting. Here is the error log - sonar.log -

--> Wrapper Started as Daemon
Launching a JVM...
Unable to start JVM: No such file or directory (2)
JVM exited while loading the application.
JVM Restarts disabled.  Shutting down.
<-- Wrapper Stopped

Machine is x86_64 GNU/Linux - Centos 5.1.

this box has java installed -

$java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

The same sonarqube package works on another machine.

Any idea what could be the issue here?

Thanks.

Upvotes: 35

Views: 61888

Answers (8)

Vishwas
Vishwas

Reputation: 11

Install jdk 11 sudo yum install java-11-openjdk -y sudo alternatives --config java

Select the JDK 11 version

Set the JDK 11 version in wrapper.conf vi /opt/sonar/conf/wrapper.conf wrapper.java.command=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-3.el8_5.x86_64/bin/java

Upvotes: 1

Mr. M
Mr. M

Reputation: 37

Try using a relative path, if your Sonar Folder is located in the same root folder as your jdk. For me my sonar and jdk are both under "Program Files", which has restrictive permission, hence the error.

E.g:

wrapper.java.command=../../../Java/jdk-11.0.4/bin/java

Upvotes: 0

pvrforpranavvr
pvrforpranavvr

Reputation: 2948

Solution 1

Set java path globally

Solution 2

  • Go to sonarqube-{version}/conf directory
  • Edit wrapper.conf file
  • Replace wrapper.java.command=java with wrapper.java.command= {path-to-your-java-bin-directory}/java

    eg: wrapper.java.command=/usr/java/bin/java

Upvotes: 0

Waqas Ahmed
Waqas Ahmed

Reputation: 5137

I was facing the same issue on sonar startup. After reading this post , i modified the JDK path in below file and it works.

  1. Modify the JDK path in wrapper.conf

  2. wrapper.java.command=%JAVA_HOME%/bin/java

Upvotes: 1

8xomaster
8xomaster

Reputation: 175

I had the same symptoms (wrapper starts then immediately stops). I tried these steps and finally succeeded (on a windows 10 pc):

1) in wrapper.conf, specified the java command:
wrapper.java.command=C:\Program Files\Java\jdk1.7...\bin\java.exe

That did not help.

2) Finally this fixed the problem. In the windows Services, open the Sonar service and then open Log On tab. Changed the Log On to myself as follows:

enter image description here

Upvotes: 4

Rishi
Rishi

Reputation: 6199

Issue was in the wrapper.conf where the java wrapper command was not getting resolved. It worked if I give the absolute path - ‘wrapper.java.command=/path/to/my/jdk/bin/java’

This could be an issue with an environment on a host.. not sure.

Few things that helped me in troubleshooting this -

  • log level changed to DEBUG in wrapper.conf
  • comments given in the wrapper.conf!

Thanks all for chiming in! Appreciate your inputs.

Upvotes: 38

Qualilogy
Qualilogy

Reputation: 789

Could you verify the Java version on the machine starting?

Java 6 is no more supported http://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Prerequisite but from your error message, I don't know if this is the problem you meet.

Upvotes: 0

ramesh027
ramesh027

Reputation: 796

1.Just close all running jvm from task manager 2. Change the port of the sonar runner from the properties

Upvotes: 5

Related Questions