# \[GitHub Actions\] Java version error

**URL:** <https://community.sonarsource.com/t/github-actions-java-version-error/36683>\
**Category:** SonarQube Cloud\
**Tags:** dotnet, java, sonarqube-cloud\
**Created:** [January 7, 2021, 12:56pm UTC](https://community.sonarsource.com/t/github-actions-java-version-error/36683 "2021-01-07T12:56:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AleksIvanovSinglet](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aleksivanovsinglet/32/18199_2.png) [@AleksIvanovSinglet](https://community.sonarsource.com/u/AleksIvanovSinglet)\
**Post date:** [January 7, 2021, 12:56pm UTC](https://community.sonarsource.com/t/github-actions-java-version-error/36683/1 "2021-01-07T12:56:51Z")

</div>

I get this error when I try to run SonarCloud.

```
The version of Java (1.8.0_275) you have used to run this analysis is deprecated and we stopped accepting it for newly created projects.

```

The implementation code is verbatim the one SonarCloud gives when setting up a project.

Upper in the log for the step, I see this:

```
INFO: Project root configuration file: D:\a\Bogus\Bogus\.sonarqube\out\sonar- 
project.properties
INFO: SonarScanner 4.4.0.2170
INFO: Java 1.8.0_275 AdoptOpenJDK (64-bit)
INFO: Windows Server 2019 10.0 amd64

```

Where does that error come from ?  
Where does “Java 1.8.0\_275 AdoptOpenJDK (64-bit)” come from ?  
Do I have control over it, so I can reference a newer version of OpenJDK, through the step or otherwise ?  
If I globally install the latest Java version inside the runner, before this SonarCloud step is executed, would it use that Java version instead of the problematic “Java 1.8.0\_275 AdoptOpenJDK (64-bit)”

---

<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:** [January 7, 2021, 1:20pm UTC](https://community.sonarsource.com/t/github-actions-java-version-error/36683/2 "2021-01-07T13:20:15Z")

</div>

Hey there.

Are you following this tutorial?

 ![Screenshot 2021-01-07 at 14.18.34](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/7/1/7113ac9325809168f1d5159fc0d5b59e99f8e903.png)

I noticed for the other categories (Maven, Gradle, .NET) we explicitly ask to setup Java 11 with this step.

```
  - name: Set up JDK 11
    uses: actions/setup-java@v1
    with:
      java-version: 1.11

```

But we don’t have it listed for **Other** , even though it uses the same `runs-on` as Maven and Gradle (`ubuntu-latest`) 🤔

Can you confirm this is the tutorial you’re following, and if so add this step after your Git checkout to see if that causes the issue to go away?

---

<div class="post-metadata">

**Author:** ![AleksIvanovSinglet](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aleksivanovsinglet/32/18199_2.png) [@AleksIvanovSinglet](https://community.sonarsource.com/u/AleksIvanovSinglet)\
**Post date:** [January 7, 2021, 3:16pm UTC](https://community.sonarsource.com/t/github-actions-java-version-error/36683/3 "2021-01-07T15:16:54Z")

</div>

Yes, thank you, this solved the error!

I was actually using an older version of the sample code, now I see it has been updated with the explicit JDK inclusion.

Without explicitly setuping Java, where does SonarCloud take the Java 1.8.0\_275 from ? Might that instance of Java come preinstalled on the GitHub Actions runner ?

---

<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:** [January 7, 2021, 3:19pm UTC](https://community.sonarsource.com/t/github-actions-java-version-error/36683/4 "2021-01-07T15:19:10Z")

</div>

Okay, so I’m guessing you weren’t using the **Other** option. I’ll follow up on that on my own! Which option were you using the (old) version of?

---

<div class="post-metadata">

**Author:** ![AleksIvanovSinglet](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aleksivanovsinglet/32/18199_2.png) [@AleksIvanovSinglet](https://community.sonarsource.com/u/AleksIvanovSinglet)\
**Post date:** [January 7, 2021, 3:20pm UTC](https://community.sonarsource.com/t/github-actions-java-version-error/36683/5 "2021-01-07T15:20:32Z")

</div>

Oh, sorry, forgot to include that. I was using the .NET option.

---

<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:** [January 7, 2021, 4:02pm UTC](https://community.sonarsource.com/t/github-actions-java-version-error/36683/6 "2021-01-07T16:02:51Z")

</div>

I understand Java 8 to be the default for the `windows-latest` image for GitHub.

> <https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md>
