Fatal error compiling: invalid target release: 1.8 [How to Solve]

MVN install reports an error in the title, which is checked in two steps:

    1. idea file – setting
    1. Maven – runner
    1. check whether the JDK version is 1.8

2. Confirm POM file configuration

    <!-- Specify the maven compile jdk version, if not specified, maven3 default with jdk 1.5 maven2 default with jdk1.3 -->                                                                           
        <!-- In general, target and source are kept consistent, however, sometimes there are cases where target differs from source in order to allow the program to run in other versions of jdk (for low version target jdk, syntax not supported in low version jdk cannot be used in the source code) -->                    
        <source>1.8</source> <! -- the JDK version used by the source code -->                                                                                             
        <target>1.8</target> <! -- The compiled version of the target class file to be generated -->                                                                                     
        <encoding>UTF-8</encoding><! -- Character set encoding -->
        <skipTests>true</skipTests><! -- skip tests-->                                                                             

Read More: