具体内容如下,tomcat也配置好了,部署也成功了,输入路径也正确但是总是不行type Exception reportmessage 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)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
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)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
应该是你的jdk环境的问题
如果你是没有用IDE的话,你一定要安装JDK。
并且在环境变量中配置JAVA_HOME这些。
你没有配置,所有在编译jsp文件的时候出错了。。
tomcat本身是java实现的,运行需要JRE
javahome怎么配置啊
俺是名学员,头一次出现这个问题,请问
javahome怎么配置啊
我这有jdk都装着呢,就是总报这个错
只能是notepad+jdk方式搞的。jb也不可能。那就按照楼上有人说的,设置好jdk的环境变量。主要是path和classpath
2.在“系统变量”中,设置3项系统变量,JAVA_HOME,PATH,CLASSPATH (注:“系统变量”对所有用户有用,而“用户变量”则只对当前登陆用户有用。对于变量的大小写,是不进行区分的。)
3.因为是默认安装,所以JDK1.5是安装在C:\Program Files\Java\jdk1.5.0里了。现在为三个变量设值;
新建 JAVA_HOME 设值 C:\Program Files\Java\jdk1.5.0
新建 CLASSPATH 设值 .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
编辑 PATH 设值 ;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin
注意事项:
配置JAVA_HOME变量的作用:JAVA_HOME路径下包括lib,bin,jre等文件夹,以后配tomcat,eclipse等java开发软件可能需要依赖此变量。
在设置系统变量Path(系统已经有),要注意前面的分号“;”,配置Path的作用:Path使系统可以在任何路径下识别java命令。
在设置系统变量CLASSPATH时,要注意前面的注意前面的“.;”,配置CLASSPATH变量的作用:为系统指明java加载类(class or lib)的路径,只有类在classpath中,java命令才能识别,其中,%JAVA_HOME%就是引用前面指定的JAVA_HOME。
用户变量的设置必须注销重登录后才起作用,但是当本次配置中所有环境变量都是系统变量,而设置系统变量的则不用。
4.测试JDK1.5的环境变量是否配置成功。
“开始”->“运行”,键入“cmd”进入命令提示符下,键入命令“java -version”,出现如下信息,说明环境变量配置成功:
java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
你的tomcat的环境配置问题。如果是安装版的话,在配置好环境变量后重装。如果是绿色解压版的,请在网上自行搜索。如果还不可以,请贴出报错信息
1·确认java的环境变量配置,java及javac命令执行正常
2·确认tomcat的环境配置,并能正常正确地启动
3·确认部署的正确性,如果没有把握,请说出具体的步骤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
根据你第一次报错的内容,是找不到javac命令进行编译(tools.jar不在classpath下),或者是因为你部署的方式不符合要求
按各位说的都试了试,变量也弄了,都配置好了5.0的也不行,我装上6.0后陈功运行了,不知道是不是那个5.0的过,如果遇到相同的情况,估计按各位楼上说的应该能解决问题。
搂着再次谢谢各位了!结贴时间有点慢了,让各位惦记了。