Select the project, then File > ProjectStructure > ProjectSettings > Modules -> sources You probably have the Language Level set at 9:

Just change it to 8 (or whatever you need) and you’re set to go.
Also, check the same Language Level settings mentioned above, under Project Settings > Project

Related Posts:
- Error: Could not find or load main class in intelliJ IDE
- String index out of bounds exception java
- Java compile error: “reached end of file while parsing }”
- Non-static variable cannot be referenced from a static context
- Non-static variable cannot be referenced from a static context
- Non-static variable cannot be referenced from a static context
- Lombok and Maven
- Else without if
- unused import statement for used ones in IntelliJ IDEA
- Error: JavaFX runtime components are missing, and are required to run this application with JDK 11
- How to fix “unsupported class file major version 60” in IntelliJ?
- intellij incorrectly saying no beans of type found for autowired repository
- JAVA_HOME should point to a JDK not a JRE
- IDEA: javac: source release 1.7 requires target release 1.7
- What does “error: ‘.class’ expected” mean and how do I fix it
- IntelliJ – Can’t start – “JAVA_HOME does not point to a valid JVM installation”
- Java error: void cannot be converted to String
- Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project
- Fatal error compiling: tools.jar not found:
- Error: Module not specified (IntelliJ IDEA)
- Invalid signature file digest for Manifest main attributes exception while trying to run jar file
- Error: ‘)’ expected compiler error
- java attempting to assign weaker access privilege error
- What is the difference between run-time error and compiler error?
- “Cannot start compilation: the output path is not specified for module…”
- Class JavaLaunchHelper is implemented in two places
- IntelliJ IDEA “The selected directory is not a valid home for JDK”
- What is the best way to implement constants in Java?
- What is the reason behind “non-static method cannot be referenced from a static context”?
- What does ” || ” mean in Java? [duplicate]
- “Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G
- “int cannot be dereferenced” in Java
- What is a Key-Value Pair?
- Create ArrayList from array
- What is null in Java?
- Understanding Spring @Autowired usage
- What is a serialVersionUID and why should I use it?
- SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
- The difference between += and =+
- exception in initializer error in java when using Netbeans
- MacOS Catalina(v 10.15.3): Error: “chromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser
- Can I catch multiple Java exceptions in the same catch clause?
- What is the use of printStackTrace() method in Java?
- How do I limit the number of decimals printed for a double?
- Please initialize the log4j system properly warning
- Understanding the difference between null and ‘\u000’ in Java
- what does Dead Code mean under Eclipse IDE Problems Section
- Java compressing Strings
- Can an abstract class have a constructor?
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- “NoClassDefFoundError: Could not initialize class” error
- Recursive print Factorial
- Recompile with -Xlint:unchecked for detail error in java
- Convert array of strings into a string in Java
- What is Serialization?
- Generate a random double in a range
- Eclipse “Error: Could not find or load main class”
- How to get locator of current web element?
- javax.naming.NameNotFoundException
- How to print out all the elements of a List in Java?
- If Java is Strongly typed then why does this code compile?
- Error: cannot find symbol ArrayList
- Choosing the best concurrency list in Java
- Why nextLine() and not nextString() ?
- Very Basic Java
- No Persistence provider for EntityManager named
- What does it mean: JavaFX application class must extend javafx.application.Application?
- Using Math.round to round to one decimal place?
- How to replace a substring of a string
- accessing a variable from another class
- “Javac” doesn’t work correctly on Windows 10
- How to convert a byte array to a hex string in Java?
- How to get the last value of an ArrayList
- MultipartException: Current request is not a multipart request
- How to extract a substring using regex
- .class vs .java
- Case expressions must be constant expressions for static final int?
- try catch ArrayIndexOutOfBoundsException?
- Response has aready been committed
- How do I test a class that has private methods, fields or inner classes?
- how to make jni.h be found?
- difference between System.out.println() and System.err.println()
- “Source folder is not a Java project” error in eclipse
- How to memory profile in Java?
- java.lang.IllegalThreadStateException
- What is an
method in Java? Can it be overridden? - The sum of all squares between 1 and 100 inclusive?
- How do I initialize a byte array in Java?
- How to map a composite key with JPA and Hibernate?
- Javac “cannot find symbol”
- Any shortcut to initialize all array elements to zero?
- compilation error: identifier expected
- Setting background images in JFrame
- Java “lambda expressions not supported at this language level”
- How to specify filepath in java?
- Issue installing Netbeans in Windows 10: Java SE Development Kit (JDK) was not found on this computer
- dequeue and enqueue methods in queue implementation
- How to specify the default error page in web.xml?
- Exception is never thrown in body of corresponding try statement
- Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2)