0

We are using

  • TFS 2015
  • SonarQube 5.6
  • .NET 4.5
  • jre1.8.0_112
  • jdk1.8.0_112

We have installed and Configure SonarQube on Same server in same box where TFS & TFS build is installed & configured.

All steps within build are succeeded other than Sonar Scanner, It shows below error.

I checked and JAVA_HOME variable is created and its pointed to correct path, i also checked with JDK path, but showing same error. I also checked with short path.

I am not sure what i am missing here.

2017-02-16T09:14:22.3510000Z Calling the SonarQube Scanner... 2017-02-16T09:14:22.3510000Z ERROR: JAVA_HOME exists but does not point to a valid Java home 2017-02-16T09:14:22.3510000Z folder. No "\bin\java.exe" file can be found there. 2017-02-16T09:14:22.3520000Z ##[error]The SonarQube Scanner did not complete successfully 2017-02-16T09:14:22.3520000Z 14:44:22.31 Creating a summary markdown file... 2017-02-16T09:14:22.3520000Z ##[error]Post-processing failed. Exit code: 1 2017-02-16T09:14:22.3590000Z ##[error]Unexpected exit code received from batch file: 1 2017-02-16T09:14:22.3710000Z The build was not set to fail if the associated quality gate fails.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Manish Joisar
  • 1,256
  • 3
  • 23
  • 47

1 Answers1

0

Check your JAVA_HOME path, and make sure it points to the java root folder, in your case to C:\Program Files (x86)\Java\1.8.0_112 or C:\Program Files\Java\1.8.0_112.

Also, check this case to see whether you have the semicolon in the path.

Community
  • 1
  • 1
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • Yes, my path is C:\Program Files\Java\jre1.8.0_112 and i can see java exe in bin folder too No semicolon after path – Manish Joisar Feb 17 '17 at 06:32
  • As you mentioned you have checked with JDK path, but showing same error, so your issue is not related to TFS, correct? Do you have other machine to set up the environment? – Cece Dong - MSFT Feb 17 '17 at 10:02
  • I have setup TFS vNext build & added steps for SonarQube i.e. Begin and End steps So i am not sure if error related to TFS or not, but error is there. It might be that i am missing something here, but not sure what. Let me know if i can provide some more information to get your help on this All steps are failing, only this i.e. last one is failing. – Manish Joisar Feb 17 '17 at 10:40
  • Please try to check the JDK path manually on the build agent machine. If you get the same error, then the issue may be related to your environment. It would you better if you could have other machine to test the JDK environment. – Cece Dong - MSFT Feb 20 '17 at 01:58
  • As i have limited scope to setup new environment, i was looking at configuration and in Sonar -> Administration-> SystemInfo, i can see java.home under jvmproperties, value is set as java.home " C:\Program Files\Java\jdk1.8.0_112\jre " Does this has any impact on sonar execution? I then changed JAVA_HOME variable to same folder in environment variable, but still same issue – Manish Joisar Feb 20 '17 at 13:55
  • If you get the same error when you check the JDK path manually on the build agent machine. Then your issue is not related to TFS. I suggest you get support from SonarQube side for better response. – Cece Dong - MSFT Feb 21 '17 at 05:58
  • Hello CeCe, sorry might be silly question but still, what do you mean by when you say "If you get the same error when you check the JDK path manually" What you want me to check? What should i do ? – Manish Joisar Feb 21 '17 at 09:43
  • In Windows at the command prompt: where javac, can you get the JDK path? – Cece Dong - MSFT Feb 21 '17 at 10:08
  • Yes, i can see \bin\Java.exe file under C:\Program Files\Java\jdk1.8.0_112 folder – Manish Joisar Feb 21 '17 at 10:18
  • My bad, i was looking at wrong build server and not where build was executed, So issue was related to wrong path in JAVA_HOME Thanks Cece, Eddie for your help and sorry for inconvenience – Manish Joisar Feb 22 '17 at 13:14
  • Iam also facing the same issue, my build server and the sobarwube server both have JDK 11, and also set the JAVA_HOME path as well on both server, so whats the issue? – Saad Awan Aug 21 '21 at 13:51