install: http://wiki.eclipse.org/Jetty/Howto/Install_Jetty
wget http://dist.codehaus.org/jetty/jetty-hightide-8.0.0/jetty-hightide-8.0.0.v20110901.tar.gz tar xfz jetty-hightide-8.0.0.v20110901.tar.gz cd jetty-hightide-8.0.0.v20110901 java -jar start.jar
or
cd ~
/
downloads
wget
-
c http:
/
/
dist.codehaus.org
/
jetty
/
jetty
-
hightide
-
8.0
.
0
/
jetty
-
hightide
-
8.0
.
0.v20110901
.tar.gz
1,Jetty启动时报错: NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
<scope>provided</scope>
<version>7.0.0pre2</version>
</dependency>
嚓。。。jetty-distribution-8.0.0.M2果断是有这个问题的,直接换个也可以没有啊eg:jetty-distribution-8.1.10.v20130312
2,访问Jetty的JSPdemo(http://localhost:8080/jsp/下)报错:PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
http://localhost:8080/jsp/dump.jsp
HTTP ERROR 500
Problem accessing /jsp/dump.jsp. Reason:
PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
Caused by:
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
原因:安装jdk的时候会往c盘的系统目录拷贝Java的课执行文件java.exe,
使用 java -jar start.jar 来启动 Jetty 时则优先使用的是系统目录下的 java.exe,这样Jetty的Jsp解析器将无法解析JDK的的安装目录
解决方案:写了个启动bat,
start.bat:
set JAVA_HOME=E:\KAI_FA\JAVA\jdk1.6.0_38
E:\KAI_FA\JAVA\jdk1.6.0_38\bin\java -jar start.jar
3,jetty
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is requiredat 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:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:368) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Unknown Source)
解决方案:解开start.ini文件注释掉的参数:-Dorg.apache.jasper.compiler.disablejsr199=true
org.apache.jasper.JasperException: PWC6345: There is an error in invokingjavac. A full JDK (not just JRE) is required
解决方案:删除 C:\WINDOWS\system32\java.exe 重启jetty
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP||PWC6199: Generated servlet error:|程序包com.sun.image.codec.jpeg不存在||