jsp在tomcat中配置运行的问题
我装的tomcat5.0.8,jdk运行正常编译java /servlet都没问题
环境变量为
classpath=.;c:\jdk1.5.0_08\lib\dt.jar;c:\jdk1.5.0_08\lib\tools.jar;c:\jdk1.5.0_08\lib\servlet-api.jar;C:\Tomcat 5.0\common\lib\jsp-api.jar
要运行JSP程序,是个小的测试程序,我把它拷到 webapp\myjsp\test.jsp
在tomcat中运行,得到
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
我看到tomcat 自带的jsp程序在WEB-INF\web.xml中有指定jsp的class,如 index.jsp
<servlet>
<servlet-name> org.apache.jsp.index_jsp </servlet-name>
<servlet-class> org.apache.jsp.index_jsp </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> org.apache.jsp.index_jsp </servlet-name>
<url-pattern> /index.jsp </url-pattern>
是不是我也要写一个servlet-class,我的目的就是让我的小小的jsp在tomcat中正常运行起来,请问如何做呢,望各位不赐吝教!谢谢!
[解决办法]
在安装tomcat选择jdk目录,默认是jre的目录
在windows系统下现在的安装程序不是不用在自己设置环境变量了吗
------解决方案--------------------
我也是菜鸟 你试试把ROOT目录下的WEB-INF拷到自己建的文件目录下试试
[解决办法]
实在不行,在ROOT文件下看看
[解决办法]
你要配置一下 JAVA_HOME 到JDK的跟路径。
c:\jdk1.5.0_08
[解决办法]
JDK的环境变量path没有配置好
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.myexception.cn/j2ee/2308.html