Intellij 2020.1.1 defaults to Java 5

Answered

This has been happening since about 2017, but I just upgraded to 2020.1.1 and it's still happening. So either it's a really dumb systemic bug, or a really dumb user (me) missing something obvious.

I've set the default Java version to 1.8 wherever I can find it, and every project always has the version set to 8. But whenever I add a module from a maven file, the default for that module is always 1.5. 

Is this a bug? On purpose? Or am I just totally obtuse?

 

Thanks!
Jeff

 

0
2 comments

Please try to add the following configuration in your pom.xml file:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>
</build>

The problem is that Maven uses 1.5 Java version even if you specified 1.8 in your project settings. Follow our guide to learn how to troubleshoot common Maven issues.

1
Avatar
Permanently deleted user

D'oh! Of course. 

My mind was so buried in IJ because of the problems I had with my project structure after upgrading I totally forgot to even look at the poms.

Thanks!

 

0

Please sign in to leave a comment.