Error:java: invalid flag: -release

We Are Going To Discuss About Error:java: invalid flag: -release. So lets Start this Java Article.

Error:java: invalid flag: -release

  1. Error:java: invalid flag: -release

    Java 9 support is cutting edge and should be tried with the most current version. At the moment, this is the public preview of 2016.3, available here.

  2. Error:java: invalid flag: -release

    Java 9 support is cutting edge and should be tried with the most current version. At the moment, this is the public preview of 2016.3, available here.

Solution 1

I was using Java 8 and Intellij 2018.1.1

I solved the issue in this way:

  • open IntelliJ Idea settings
  • navigate to Build, Execution, Deployment > Compiler > Java Compiler
  • Uncheck the option: Use '--release' option for cross-compilation (Java 9 and later)

Intellij Settings

Original Author Roberto Of This Content

Solution 2

Java 9 support is cutting edge and should be tried with the most current version. At the moment, this is the public preview of 2016.3, available here.

Original Author Nicolai Parlog Of This Content

Solution 3

Had exactly the same Error:java: invalid flag: -release in Intellij 2017.1. Updating to 2017.2.5 resolves the issue.

Original Author Dunx Of This Content

Solution 4

Can be caused by mismatch of java version on build configuration and module settings.

Original Author Bohdan Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment