Maven web project--running error: Unable to compile class for JSP

Error Information:
HTTP Status 500
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the generated java file
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files


Error Cause:
apache-maven-3.5.0: default running tomcat is Apache Tomcat/6.0.29, but Apache Tomcat/6.0.29 is not available for jdk1.8.0.


Error Solution:
Configure my pom.xml like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</build>
run.png

Thanks to Apache Tomcat Maven Plugin.