jetty访问jsp页面出现异常:org.apache.jasper.JasperException: PWC6345: A full JDK (not just JRE) is required解决

今天在jetty下配置一个jsp模版的报表页面,报如下异常信息:

org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:378)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:119)
    at org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompiler.java:208)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:384)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:558)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:489)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:972)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:906)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
    at org.eclipse.jetty.server.Server.handle(Server.java:350)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:910)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
    at java.lang.Thread.run(Unknown Source)


在网上找了很多资料,主要问题还是jetty运行的jre环境配置问题,最终解决方案如下:
在eclipse—>Window—>prefence—>java—>Installed JREs,选择jre点击Edit找到jdk的安装目录,我的安装在C:Program Files/java/jdk1.7在jdk安装目录下找到jre目录,点击finish。,启动项目,访问jsp页面,一切正常。

提醒:网上的解决方案我试了不成功,主要原因就是因为jre配置环境的错误,在选择jre环境的时候,有两个选择,一个是java根目录下的jre(选择这个会不成功),一个是在jdk根目录下的jre(选择这个成功)!!

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。