5

I have just installed sonnar runner on windows 7 using guidelines from sonarqube.com

I have installed sonnarqube4.5 and sonar-runner on C drive but my project is in xampp/htdocs in D drive.

Now when I am trying to start sonnar runner using command line, I get following error:

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Administrator>cd..

C:\Users>cd..

C:>cd WIndows

C:\Windows>d:

D:>cd xampp

D:\xampp>cd htdocs

D:\xampp\htdocs>sonar-runner -e 'sonar-runner' is not recognized as an internal or external command, operable program or batch file.

Is this because I have project and sonnarqube on different drives? Please help.

A-Sharabiani
  • 17,750
  • 17
  • 113
  • 128
Swati
  • 61
  • 1
  • 1
  • 6

2 Answers2

4

It's because the sonar-runner executable is not in your current directory and Windows do not know where to find it. You need to add the directory containing sonar-runner to your PATH environment variable (see this thread for a similar case).

Note: SonarQube 4.5 is ancient, you should use the latest 5.6 LTS instead.

Community
  • 1
  • 1
Nicolas B.
  • 7,245
  • 17
  • 29
  • thanks for replying. I added system variable and also appended in evvironment variable. Here is my path variable now: C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Skype\Phone;%SONAR_RUNNER_HOME%\bin – Swati Jun 08 '16 at 08:09
  • I had to download and setup sonar scanner , sonar runner was not working. After setting environment variable properly , all issues were resolved. – Swati Jun 08 '16 at 12:15
  • @Swati, do we need to use sonar scanner in order to make 'sonar-runner' working ? – Suresh Oct 28 '21 at 13:39
1

Go to this link https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/

download sonarscanner depends on your os,

then unzip it

C:\sonar-scanner-4.6.2.2472-windows\bin\sonar-scanner.bat

add the path to environment variable

Mohamed MS
  • 51
  • 3