# How to do analysis java 8 application with sonarqube 9.3

**URL:** <https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225>\
**Category:** SonarQube Server / Community Build\
**Created:** [March 21, 2022, 9:13am UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225 "2022-03-21T09:13:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kattesang](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kattesang](https://community.sonarsource.com/u/kattesang)\
**Post date:** [March 21, 2022, 9:13am UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/1 "2022-03-21T09:13:02Z")

</div>

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

- which versions are you using  
SonarQube 9.3

- what are you trying to achieve  
Try to analysis java gradle project developed using Java 8 with gradle version 3 in azure devops pipeline.

- what have you tried so far to achieve this  
In a command line task, I have used the command gradlew sonarqube -Dsonar.projectkey=project1 -Dsonar.host.url=https://sonarqube.abc.com Dsonar.login=\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

But it is giving the error as “Could not determine java version from ‘11.0.13’”. As it is not possible to upgrade every application to java 11. So please let us know any workaround available to support old java application.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 21, 2022, 8:02pm UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/2 "2022-03-21T20:02:44Z")

</div>

Hi,

You don’t have to _build_ with Java 11. You only have to _analyze_ with it. So your options are to use two different JREs for these two different steps, or to compile _to_ a Java 8 target.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![kattesang](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kattesang](https://community.sonarsource.com/u/kattesang)\
**Post date:** [March 22, 2022, 12:31pm UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/3 "2022-03-22T12:31:50Z")

</div>

Hi Ann, Please brief me how to do it

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 22, 2022, 2:03pm UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/4 "2022-03-22T14:03:01Z")

</div>

Hi,

[The docs](https://docs.sonarqube.org/latest/analysis/languages/java/#header-3) should help.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![kattesang](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kattesang](https://community.sonarsource.com/u/kattesang)\
**Post date:** [March 23, 2022, 4:05am UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/5 "2022-03-23T04:05:44Z")

</div>

I saw this document and I am following the below two steps.

1. Prepare Analysis Configuration Task  
Under Additional Properties I have mentioned the sonar project key.

2. Gradle Task  
Under Advanced section I have set the JDK 8 path. Under SonarQube analysis section, I have set the “SonarQube scanner for Gradle plugin version” as 3.3

But I am getting the error as below.

FAILURE: Build failed with an exception.

- What went wrong:  
Execution failed for task ‘:sonarqube’.

> org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 23, 2022, 2:07pm UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/6 "2022-03-23T14:07:04Z")

</div>

Hi,

This is not about the Gradle version.

That error is telling you that you haven’t separated build and analysis, so they’re using (trying to) the same JVM: Java 8. And analysis won’t run on Java 8. You need to make this two entirely separate steps, using two different JVMs. Or you need to compile with Java 11 and [set your target to 1.8](https://discuss.gradle.org/t/how-to-set-compiler-target-to-java-8/30431).

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![kattesang](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kattesang](https://community.sonarsource.com/u/kattesang)\
**Post date:** [March 24, 2022, 1:45pm UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/7 "2022-03-24T13:45:45Z")

</div>

Hi Ann,

As you mentioned I have added two gradle task. One for build with JDK 8 and one for analysis with JDK11. But I am getting the error as below

FAILURE: Build failed with an exception.

- What went wrong:  
Could not determine java version from ‘11.0.13’.

In the In gradle-wrapper.properties, gradle version is mentioned as 3. If I increase the gradle version to higher, the code was not building. So without gradle task, do we have any option to scan Java 8 code so I don’t require to increase the gradle version?

Thanks.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 24, 2022, 1:48pm UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/8 "2022-03-24T13:48:59Z")

</div>

Hi,

I’m not a Gradle expert, so I can’t sort that out for you. What I know is that you can use Java 11 to build _to_ a Java 8 target.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![morayke](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@morayke](https://community.sonarsource.com/u/morayke)\
**Post date:** [March 23, 2024, 7:35pm UTC](https://community.sonarsource.com/t/how-to-do-analysis-java-8-application-with-sonarqube-9-3/60225/9 "2024-03-23T19:35:39Z")

</div>

HI @kattesang ,

I have the same problem. I have project with GWT 2.7. So i can’t compile with java 11 and target 8.

Did you find a solution ?
