Maven 3.3.1+ requires JDK 1.7+, but I'm using JDK 17

Answered

In the general settings, I've got the maven version set to "Bundled", which is 3.8.1.

In the project settings, I have SDK set to Intellij IDE IU-211-7142.45 Oracle OpenJDK 17.0.2 and the language level set to 17.

Yet when I try to Build Project, I get 

Error running 'my-project [clean, install...] Maven 3.3.1+ requires JDK 1.7+. Please set appropriate JDK

Is there some other setting I'm missing?

(Note: The "live" parsing seems to work, as classes, annotations, etc. are properly pretty-printed, with no errors showing.)

 

IntelliJ IDEA 2022.1.2 (Ultimate Edition)
Build #IU-221.5787.30, built on May 31, 2022
Runtime version: 11.0.15+10-b2043.56 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 8192M
Cores: 12
Registry:
    debugger.watches.in.variables=false
    ide.allow.merge.buttons=false

Non-Bundled Plugins:
    cc.ssnoodles.db2j-plugin-ce (1.0.5)
    com.jetbrains.ChooseRuntime (1.2)
    Builder Generator (1.1.8)
    GenerateSerialVersionUID (3.0.3)
    String Manipulation (9.5.0)
    MavenRunHelper (4.20.213.3714.1)
    com.euphoricity.gitignore (0.3)
    com.intellij.spring.webflow (221.5787.20)
    de.u-mass.idea.copyConstructor (1.2)
    pro.bashsupport (2.1.8.221)
    org.exbin.deltahex.intellij (0.2.6)
    com.haulmont.jpab (2022.2.5-221)

Kotlin: 221-1.6.21-release-337-IJ5787.30

0
6 comments

Could you provide screenshots from Settings/Preferences | Build, Execution, Deployment | Build Tools | Maven and Settings/Preferences | Build, Execution, Deployment | Build Tools | Maven | Importing .

0

Here you go.

Thanks for the quick response!

 

 

1

>In the project settings, I have SDK set to Intellij IDE IU-211-7142.45 Oracle OpenJDK 17.0.2 

Why are you setting the Project SDK to the IntelliJ IDEA SDK? Are you developing an IntelliJ plugin?

Please set the JDK for Maven imported to the proper JDK, e.g. 17 or any other JDK version not older than 1.7 in the Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Importing | JDK for importer.

1

I'll try that, thanks. 

I'm using the IJ IDE SDK because I was advised to use that one instead of a "normal" distro a while back--in response to some other problem I posted about, IIRC.

0

Switching to an external JDK worked. Thanks a ton!

 

0

Great! Thanks for the information.

0

Please sign in to leave a comment.