We Are Going To Discuss About Error:java: invalid flag: -release. So lets Start this Java Article.
Error:java: invalid flag: -release
- 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.
- 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)
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.