After plugin update I get "invalid flag: --release"

Answered

After IntelliJ updated som plugins I get this error when building using maven (Java 11):

"invalid flag: --release"

I've tried to fix it by unchecking 

"Use '--release' option for cross-compiulation (Java 9 and later)

This didn't help. Any idea what has gone wrong with IntelliJ ?

 

Detals:

IntelliJ IDEA 2021.2 (Ultimate Edition)
Build #IU-212.4746.92, built on July 27, 2021
Licensed to Altran Sverige AB / Niklas Modin
Subscription is active until November 13, 2021.
Runtime version: 11.0.11+9-b1504.13 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8

Kotlin: 212-1.5.10-release-IJ4746.92

0
8 comments

Hello,

What is the source/target language level used for this project and its modules? http://stackoverflow.com/a/12900859/104891

Please provide a project sample and the IDE logs for the investigation. (Help | Collect Logs and Diagnostic Data)

The files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID)

0

They are all set to 11, so that doesn't seem to be the problem. I checked both Compiler Settings and Language Levels on all Modules under Project Structure

This just started happening today after there were some updates happening.

Upload ID: 2021_08_04_XFn9xN8CnvMEi2uU

0

Does this problem occur if you build a project with Maven from the command line outside the IDE?

0

No everything works fine when building from command prompt so I can work around it for now.

 

0

In logs I see exception from https://youtrack.jetbrains.com/issue/IDEA-274759 issue. Could you please try downloading and enabling the Java EE: Enterprise Java Beans (EJB) plugin and re-import Maven project?

If issue remains - what JDK do you have set for project and each module?

Do you have any specific java compiler plugin configuration in Maven?

0

Installed the JavaEE EJB plugin but that didn't help.

I then checked the JDK for both project and modules, and they were all set to JDK 11. 
This is also what I have specified in my root pom (<release>11</release).

I then found that as I had renamed a module, I ended up with to .iml files in one place, so I dropped
dropped the whole .idea folder and all .iml files I found including the root, restarted and let IntelliJ re-index
everything and that seems to have done the trick! :)

Would have been good to know the exact cause though, but I'm a happy camper again.
Thanks for the support! 

0

For me, the problem cleared once I set my environment variable JAVA_HOME=%JAVA_HOME_8% (Note: JAVA_HOME_8 and JAVA_HOME_11 are variable I created env variables that I've created myself to point to their respective versions)

1

Incorrect environment variable turned out to be the issue for me too - this was pointing to the path of an old version of the JDK (I think which was set by Visual Studio) - updated to the path of the latest JDK that I had installed and problem solved

0

Please sign in to leave a comment.