# Getting parse error with java when scanning source files with SQ

**URL:** <https://community.sonarsource.com/t/getting-parse-error-with-java-when-scanning-source-files-with-sq/40505>\
**Category:** SonarQube Server / Community Build\
**Tags:** java\
**Created:** [March 23, 2021, 7:25am UTC](https://community.sonarsource.com/t/getting-parse-error-with-java-when-scanning-source-files-with-sq/40505 "2021-03-23T07:25:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohit\_jalal](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rohit_jalal/32/13309_2.png) [@rohit\_jalal](https://community.sonarsource.com/u/rohit_jalal)\
**Post date:** [March 23, 2021, 7:25am UTC](https://community.sonarsource.com/t/getting-parse-error-with-java-when-scanning-source-files-with-sq/40505/1 "2021-03-23T07:25:22Z")

</div>

Must-share information (formatted with [Markdown](https://commonmark.org/help/)):

- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this

Is it due to Checkstyle Plugin as its running on version 4.21??

SQ version:–7.9.4  
Scanner :— 4.6.0.2311  
Plugin:–

```auto
12:39:47 07:09:47.779 DEBUG: ‘uiv-core/src/main/java/com/nokia/nsw/uiv/validator/utils/UpdateTrigger.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.798 DEBUG: ‘uiv-core/src/test/java/package-info.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.815 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/adapterName.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.845 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/adapterName.java’
12:39:47 07:09:47.845 ERROR: Parse error at line 1 column 0: Syntax error on token “package”, enum expected
12:39:47 07:09:47.847 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/common/ __adapterName__ Configuration.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.864 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/common/ __adapterName__ Configuration.java’
12:39:47 07:09:47.864 ERROR: Parse error at line 1 column 0: Syntax error on token “package”, enum expected
12:39:47 07:09:47.866 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/preprocessor/ __adapterName__ FileHeaderProcessor.java’ generated metadata with charset ‘UTF-8’
12:39:47 07:09:47.884 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/adapter/preprocessor/ __adapterName__ FileHeaderProcessor.java’
12:39:47 07:09:47.884 ERROR: Parse error at line 4 column 0: Syntax error on token “package”, enum expected
12:39:47 07:09:47.885 DEBUG: ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/collector/ __adapterName__ Collector.java’ generated metadata with charset ‘UTF-8’
12:39:48 07:09:47.908 ERROR: Unable to parse source file : ‘uiv-federation-adapter-archetype/src/main/resources/archetype-resources/src/main/java/collector/ __adapterName__ Collector.java’
12:39:48 07:09:47.908 ERROR: Parse error at line 1 column 0: Syntax error on token “package”, enum expected

```

---

<div class="post-metadata">

**Author:** ![Joe](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/joe/32/14820_2.png) [@Joe](https://community.sonarsource.com/u/Joe)\
**Post date:** [April 8, 2021, 3:42am UTC](https://community.sonarsource.com/t/getting-parse-error-with-java-when-scanning-source-files-with-sq/40505/2 "2021-04-08T03:42:41Z")

</div>

Hi @rohit_jalal ,

Are you using Checkstyle Plugin version 4.21? Try updating to version 8.40.0 and try it again, see [https://github.com/checkstyle/sonar-checkstyle](https://github.com/checkstyle/sonar-checkstyle) for more info.

Joe
