无法编译jsp是因为什么

来源:百度知道 编辑:UC知道 时间:2024/06/24 01:45:10
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

No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:413)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:

This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.

这里不是说了么

把jdk安装目录下lib/tools.jar 复制到tomcat 的common/lib 下就ok了

"No Java compiler was found to compile the generated source for the JSP"
是你的Java虚拟机的问题吧!将你安装jdk的目录放在环境变量的系统变量的path里,用;分开就可以了应该。能不能好我也不能确定,其实你可以下载最新的jdk和tomcat,tomcat都不用配置环境变量就可以用!jdk就像我上面那样说的那样配置一下环境变量就可以,其他的都不用那个配置,试试看!

检查tomcat吧!
如果你的项目能在别人的电脑上运行但却不能在自己的电脑上运行的话,那说明你的电脑某个设置起了一点冲突!
好好检查看吧!

“我已经把jdk安装目录下lib/tools.jar 复制到tomcat 的common/lib 下”实在是多此一举。给你的提示都很明确了,“No Java compiler was found to compile the generated source for the JSP”,只要环境变量真的配置好了,就不会有这种问题。

========================================

“保证j2sdk,tomcat,以及环境变量都没问题”?就是环境变量问题。

看看项目需要的包是否导入到tomcat下了