# Sonar scanner configuration for Java projects

**URL:** <https://community.sonarsource.com/t/sonar-scanner-configuration-for-java-projects/132282>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, java, scanner\
**Created:** [December 17, 2024, 12:34pm UTC](https://community.sonarsource.com/t/sonar-scanner-configuration-for-java-projects/132282 "2024-12-17T12:34:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShinyDhas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/shinydhas/32/64565_2.png) [@ShinyDhas](https://community.sonarsource.com/u/ShinyDhas)\
**Post date:** [December 17, 2024, 12:34pm UTC](https://community.sonarsource.com/t/sonar-scanner-configuration-for-java-projects/132282/1 "2024-12-17T12:34:43Z")

</div>

I am trying to do analysis of a java project,I have configured the pom.xml to have sonar-maven-plugin version `5.0.0.4389` and also java jre version 17 is installed. When I run the maven clean verify command it fails with the unsupported version 17. We have maven-compiler plugin version of 3.10

```auto
<build>
        <plugins>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>5.0.0.4389</version>
            </plugin>

```

```auto
ARG MAVEN_VERSION=3.9.9
ARG USER_HOME_DIR="/root"
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
 && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
 && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
 && rm -f /tmp/apache-maven.tar.gz \
 && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"

# Define working directory.
WORKDIR /data

# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/default-jvm/

```

Any idea as to why this happens?

---

<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:** [December 18, 2024, 8:32am UTC](https://community.sonarsource.com/t/sonar-scanner-configuration-for-java-projects/132282/2 "2024-12-18T08:32:41Z")

</div>

Can you share the logs where you receive an error?
