# [issue] JSP 報錯說 Java Build Path 找不到"javax.servlet.http.HttpServlet" 這個問題通常出現在所有 jsp 上且顯示在幾乎不可能錯誤的句子例如: `<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>` 表示這通常是 Elipse/Tomcat 設定問題,而非網頁程式撰寫出錯 有幾個檢查點可以查: 1. 對專案 Properties > Project Facets > 確定勾選 Java、Dynamic Web Module,以及JAX-RS 2. 確定有加入 servlet-api-3.1.jar ``` Maven <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency> Gradle configurations { provided } sourceSets { main { compileClasspath += configurations.provided } } dependencies { provided 'javax.servlet:javax.servlet-api:3.1.0' } ``` 3. 對專案 Properties > Target Runtime 設定為 Tomcat [The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path [duplicate] ](https://stackoverflow.com/questions/22756153/the-superclass-javax-servlet-http-httpservlet-was-not-found-on-the-java-build) ###### tags: `Java`