Answers: <p>I have added <strong>"C:\Program Files\Java\jdk-12.0.2"</strong> as value of <strong>JAVA_HOME</strong> environment Variable and its working. I don't know exactly this is the correct solution OR Not, but when I have checked <strong>sonar-scanner.bat</strong> file then it's taking %JAVA_HOME%/bin/java.exe location of Java. </p>
  
Answers: CC BY-SA 4.0
Answers: 2019-11-05T07:28:02.093Z
Answers: 2019-11-05T07:28:02.093Z
Answers: ankit thakkar
Answers: <p>Check if there is a file at C:\Program Files\Java\jdk-12.0.2\bin\java.exe.</p>
  
  <p>If yes then I'd wager there is quoting issue in the SonarQube or the MSBuild task that does not like the space in the path.<br>
  Install your java in a path without a space that will likely help</p>
  
  <p>If No, well...  you just found your problem !</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-11-04T13:28:17.260Z
Answers: Yes "C:\Program Files\Java\jdk-12.0.2\bin\java.exe." exist.  A few days back it was working fine, suddenly I am getting this error.
Answers: ankit thakkar
Answers: CC BY-SA 4.0
Answers: 2019-11-04T13:18:20.533Z
Answers: 2019-11-04T13:18:20.533Z
Answers: Newtopian
Body: <p>I have set up a sonar scanner MSBuild in Jenkins, but suddenly I'm getting below error.</p>
  
  <pre><code>ERROR: JAVA_HOME exists but does not point to a valid Java home
         folder. No "\bin\java.exe" file can be found there.
  </code></pre>
  
  <p>Below is Environment variable for Java Jdk</p>
  
  <pre><code>JAVA_HOME=C:\Program Files\Java\jdk-12.0.2
  </code></pre>
  
  <p>How to solve this Issue?</p>
  
Comments: CC BY-SA 4.0
Comments: 2019-11-04T10:50:33.250Z
Comments: More Information: I am getting this error only for **Sonar Scanner for MsBuild - End Analysis** task only in Jenkins.
Comments: ankit thakkar
Tags: <jenkins><sonarqube>
Title: JAVA_HOME error in Sonar Scanner for MSBuild
UserDisplayName: ankit thakkar
ThreadText: # JAVA_HOME error in Sonar Scanner for MSBuild
  
  (Asked by: username_0 on 2019-11-04)
  
  I have set up a sonar scanner MSBuild in Jenkins, but suddenly I'm getting below error.
  
  ```
  ERROR: JAVA_HOME exists but does not point to a valid Java home
         folder. No "\bin\java.exe" file can be found there.
  
  ```
  
  Below is Environment variable for Java Jdk
  
  ```
  JAVA_HOME=C:\Program Files\Java\jdk-12.0.2
  
  ```
  
  How to solve this Issue?
  
  **Tags:** jenkins, sonarqube
  
  > **Comments:**
  > **username_0**: More Information: I am getting this error only for **Sonar Scanner for MsBuild - End Analysis** task only in Jenkins.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2019-11-05. Score: 1
  
  I have added **"C:\Program Files\Java\jdk-12.0.2"** as value of **JAVA\_HOME** environment Variable and its working. I don't know exactly this is the correct solution OR Not, but when I have checked **sonar-scanner.bat** file then it's taking %JAVA\_HOME%/bin/java.exe location of Java.
  
  
  ---
  
  ### Answer by username_1 on 2019-11-04. Score: 0
  
  Check if there is a file at C:\Program Files\Java\jdk-12.0.2\bin\java.exe.
  
  If yes then I'd wager there is quoting issue in the SonarQube or the MSBuild task that does not like the space in the path.  
  Install your java in a path without a space that will likely help
  
  If No, well... you just found your problem !
  
  > **Comments:**
  > **username_0**: Yes "C:\Program Files\Java\jdk-12.0.2\bin\java.exe." exist.  A few days back it was working fine, suddenly I am getting this error.  
  
  ---
  
  