# Analyzing Java8 code with JDK11 - deprecations

**URL:** <https://community.sonarsource.com/t/analyzing-java8-code-with-jdk11-deprecations/28012>\
**Category:** SonarQube Cloud\
**Tags:** scanner, java, sonarqube-cloud\
**Created:** [July 13, 2020, 10:15am UTC](https://community.sonarsource.com/t/analyzing-java8-code-with-jdk11-deprecations/28012 "2020-07-13T10:15:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrozenblyum](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/lrozenblyum/32/11922_2.png) [@lrozenblyum](https://community.sonarsource.com/u/lrozenblyum)\
**Post date:** [July 13, 2020, 10:15am UTC](https://community.sonarsource.com/t/analyzing-java8-code-with-jdk11-deprecations/28012/1 "2020-07-13T10:15:23Z")

</div>

- ALM used: Bitbucket Cloud
- CI system used: Jenkins
- Steps to reproduce

We’re trying to move to SonarScanner based on JDK11 for a Java8 project.  
We face multiple deprecation warnings about the code like this  
`new Integer(...)`  
`Class.forName(...).newInstance();`  
The problem is that those methods are not deprecated in JDK1.8 (while they’re in JDK11).  
How to correctly solve the issue?  
Setting **sonar.java.source** explicitly = 1.8 didn’t help.

---

<div class="post-metadata">

**Author:** ![Olexandr\_Kuper](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/olexandr_kuper/32/3733_2.png) [@Olexandr\_Kuper](https://community.sonarsource.com/u/Olexandr_Kuper)\
**Post date:** [July 13, 2020, 10:34am UTC](https://community.sonarsource.com/t/analyzing-java8-code-with-jdk11-deprecations/28012/2 "2020-07-13T10:34:04Z")

</div>

I have the same problem.

---

<div class="post-metadata">

**Author:** ![Michael](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/michael/32/43_2.png) [@Michael](https://community.sonarsource.com/u/Michael)\
**Post date:** [November 5, 2020, 3:40pm UTC](https://community.sonarsource.com/t/analyzing-java8-code-with-jdk11-deprecations/28012/6 "2020-11-05T15:40:51Z")

</div>

Hello there,

Sorry for the very long time you had to wait before getting an answer. This is, unfortunately, a known issue, on which we are currently (and finally) working. The JDK analyzed by the project being not the same one used during the analysis, and consequently reporting issues that are not fixable.

Hopefully, our next Java Analyzer release should allow us to be able to handle these cases correctly, and not report FPs of this kind anymore. You can track the ticket here: [SONARJAVA-3056](https://jira.sonarsource.com/browse/SONARJAVA-3056)

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![lrozenblyum](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/lrozenblyum/32/11922_2.png) [@lrozenblyum](https://community.sonarsource.com/u/lrozenblyum)\
**Post date:** [November 6, 2020, 7:39am UTC](https://community.sonarsource.com/t/analyzing-java8-code-with-jdk11-deprecations/28012/8 "2020-11-06T07:39:16Z")

</div>

Thanks Michael!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [November 13, 2020, 7:39am UTC](https://community.sonarsource.com/t/analyzing-java8-code-with-jdk11-deprecations/28012/9 "2020-11-13T07:39:16Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
