title: HTTP Status 500 - Unable to compile class for JSP in Eclipse with the Date method
body: <p>I'm using Eclipse Kepler.
  I keep getting an error message with this code in a .jsp:</p>
  
  <p>HTTP Status 500 - Unable to compile class for JSP: </p>
  
  <hr>
  
  <p>type Exception report</p>
  
  <p>message Unable to compile class for JSP: </p>
  
  <p>description The server encountered an internal error that prevented it from fulfilling this request.</p>
  
  <p>exception </p>
  
  <p>org.apache.jasper.JasperException: Unable to compile class for JSP: </p>
  
  <p>An error occurred at line: 13 in the jsp file: /index.jsp
  Syntax error on token "import", delete this token
  10: 
  11: 
  12: 
  13: &lt;% page import ="java.util.Date" %>
  14: 
  15: &lt;%= new Date () %>
  16: </p>
  
  <p>An error occurred at line: 13 in the jsp file: /index.jsp
  Syntax error, insert ";" to complete Statement
  10: 
  11: 
  12: 
  13: &lt;% page import ="java.util.Date" %>
  14: 
  15: &lt;%= new Date () %>
  16: </p>
  
  <p>An error occurred at line: 15 in the jsp file: /index.jsp
  Date cannot be resolved to a type
  12: 
  13: &lt;% page import ="java.util.Date" %>
  14: 
  15: &lt;%= new Date () %>
  16: 
  17: 
  18:  </p>
  
  <p>Stacktrace:
      org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
      org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)</p>
  
  <p>note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.</p>
  
  <hr>
  
  <h2>Apache Tomcat/7.0.42</h2>
  
  <p>There is the code:</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  &lt;% page import ="java.util.Date" %&gt;
  
  &lt;%= new Date () %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>Thank you</p>