Thanks for all the answers, my question was solved by this website's method #1.
https://dev.to/techgirl1908/intellij-error-java-release-version-5-not-supported-376