# Sonar-scanner java.nio.file.InvalidPathException on scanning C++ sources

**URL:** <https://community.sonarsource.com/t/sonar-scanner-java-nio-file-invalidpathexception-on-scanning-c-sources/69439>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, cfamily, scanner\
**Created:** [August 8, 2022, 9:12am UTC](https://community.sonarsource.com/t/sonar-scanner-java-nio-file-invalidpathexception-on-scanning-c-sources/69439 "2022-08-08T09:12:17Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [August 8, 2022, 1:30pm UTC](https://community.sonarsource.com/t/sonar-scanner-java-nio-file-invalidpathexception-on-scanning-c-sources/69439/5 "2022-08-08T13:30:07Z")

</div>

Take a look at this thread – it may not be the file names on the filesystem that is the issue

> [@Build-wrapper-dump.json does not match analyzer 6.20.4.45706 version](https://community.sonarsource.com/t/build-wrapper-dump-json-does-not-match-analyzer-6-20-4-45706-version/62245/7):
>
> Nope, the actual file names are fine wink The resolving of the includes in c++ causes this issue. Something like this #include "detailtextdlg.h " Will be resolved to a path with trailing whitespaces, which causes the error in WindowsPathParser. The Issue is solved by executing regex search and replace of all include statements that contained a trailing space, for example, #include "detailtextdlg.h " to #include "detailtextdlg.h" i.e: our builds are green again wink

---

_[View the full topic](https://community.sonarsource.com/t/sonar-scanner-java-nio-file-invalidpathexception-on-scanning-c-sources/69439)._
