您的位置:首页 > 运维架构 > Tomcat

win7下tomcat5.0.28安装版以服务方式启动报jsp不能解析的原因

2015-04-17 19:10 447 查看
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

com.sun.tools.javac.Main is not on the classpath.

Perhaps JAVA_HOME does not point to the JDK.

如果以Tomcat以startup.bat方式启动正常,而通过Tomcat服务随系统启动试,jsp页面有以上错误时,说明java和tomcat的环境变量配置没问题(安装版tomcat无需手动配置环境变量)。

方法一:

启动Tomcat时的Classpath上,tools.jar在Tomcat启动时需要,但现在找不到(事实上系统变量Classpath已经指明了 tools.jar所在),系统是去JRE的lib下找,可是这个包默认应该在[JDK]的lib下(注:用的是JDK build 1.4.2_03-b02),问题的解决很简单,只要复制[JDK]tools.jar到[JRE]下即可。

方法二:

直接将C:/Program Files/Java/jdk1.5.0_11/lib中的tools.lib拷贝到tomcat根目录中的common\lib中,重启服务即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: